clippy: pass &str/&[..] instead of &String/&Vec

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2021-01-19 14:46:39 +01:00
parent ccec086e25
commit 09faa9ee95
4 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ enum PruneMark { Keep, KeepPartial, Remove }
fn mark_selections<F: Fn(&BackupInfo) -> Result<String, Error>> (
mark: &mut HashMap<PathBuf, PruneMark>,
list: &Vec<BackupInfo>,
list: &[BackupInfo],
keep: usize,
select_id: F,
) -> Result<(), Error> {
@ -45,7 +45,7 @@ fn mark_selections<F: Fn(&BackupInfo) -> Result<String, Error>> (
fn remove_incomplete_snapshots(
mark: &mut HashMap<PathBuf, PruneMark>,
list: &Vec<BackupInfo>,
list: &[BackupInfo],
) {
let mut keep_unfinished = true;

View File

@ -376,7 +376,7 @@ fn get_server_url() -> (String, usize) {
}
pub fn send_updates_available(
updates: &Vec<&APTUpdateInfo>,
updates: &[&APTUpdateInfo],
) -> Result<(), Error> {
// update mails always go to the root@pam configured email..
if let Some(email) = lookup_user_email(Userid::root_userid()) {

View File

@ -173,7 +173,7 @@ pub fn update_changer_online_status(
drive_config: &SectionConfigData,
inventory: &mut Inventory,
changer_name: &str,
label_text_list: &Vec<String>,
label_text_list: &[String],
) -> Result<(), Error> {
let mut online_map = OnlineStatusMap::new(drive_config)?;

View File

@ -87,8 +87,8 @@ pub struct SubscriptionInfo {
}
async fn register_subscription(
key: &String,
server_id: &String,
key: &str,
server_id: &str,
checktime: i64
) -> Result<(String, String), Error> {
// WHCMS sample code feeds the key into this, but it's just a challenge, so keep it simple