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>> ( fn mark_selections<F: Fn(&BackupInfo) -> Result<String, Error>> (
mark: &mut HashMap<PathBuf, PruneMark>, mark: &mut HashMap<PathBuf, PruneMark>,
list: &Vec<BackupInfo>, list: &[BackupInfo],
keep: usize, keep: usize,
select_id: F, select_id: F,
) -> Result<(), Error> { ) -> Result<(), Error> {
@ -45,7 +45,7 @@ fn mark_selections<F: Fn(&BackupInfo) -> Result<String, Error>> (
fn remove_incomplete_snapshots( fn remove_incomplete_snapshots(
mark: &mut HashMap<PathBuf, PruneMark>, mark: &mut HashMap<PathBuf, PruneMark>,
list: &Vec<BackupInfo>, list: &[BackupInfo],
) { ) {
let mut keep_unfinished = true; let mut keep_unfinished = true;

View File

@ -376,7 +376,7 @@ fn get_server_url() -> (String, usize) {
} }
pub fn send_updates_available( pub fn send_updates_available(
updates: &Vec<&APTUpdateInfo>, updates: &[&APTUpdateInfo],
) -> Result<(), Error> { ) -> Result<(), Error> {
// update mails always go to the root@pam configured email.. // update mails always go to the root@pam configured email..
if let Some(email) = lookup_user_email(Userid::root_userid()) { 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, drive_config: &SectionConfigData,
inventory: &mut Inventory, inventory: &mut Inventory,
changer_name: &str, changer_name: &str,
label_text_list: &Vec<String>, label_text_list: &[String],
) -> Result<(), Error> { ) -> Result<(), Error> {
let mut online_map = OnlineStatusMap::new(drive_config)?; let mut online_map = OnlineStatusMap::new(drive_config)?;

View File

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