Skip to content

Commit

Permalink
style(mock): use cloned to fix clippy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Sandro-Alessio Gierens <sandro@gierens.de>
  • Loading branch information
gierens committed Apr 23, 2024
1 parent 8587119 commit d830997
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,21 @@ impl Users for MockUsers {
}

fn get_current_username(&self) -> Option<Arc<OsStr>> {
self.users.get(&self.uid).map(|u| Arc::clone(&u.name_arc))
self.users
.get(&self.uid)
.cloned()
.map(|u| Arc::clone(&u.name_arc))
}

fn get_effective_uid(&self) -> uid_t {
self.uid
}

fn get_effective_username(&self) -> Option<Arc<OsStr>> {
self.users.get(&self.uid).map(|u| Arc::clone(&u.name_arc))
self.users
.get(&self.uid)
.cloned()
.map(|u| Arc::clone(&u.name_arc))
}
}

Expand All @@ -159,15 +165,21 @@ impl Groups for MockUsers {
}

fn get_current_groupname(&self) -> Option<Arc<OsStr>> {
self.groups.get(&self.uid).map(|u| Arc::clone(&u.name_arc))
self.groups
.get(&self.uid)
.cloned()
.map(|u| Arc::clone(&u.name_arc))
}

fn get_effective_gid(&self) -> uid_t {
self.uid
}

fn get_effective_groupname(&self) -> Option<Arc<OsStr>> {
self.groups.get(&self.uid).map(|u| Arc::clone(&u.name_arc))
self.groups
.get(&self.uid)
.cloned()
.map(|u| Arc::clone(&u.name_arc))
}
}

Expand Down

0 comments on commit d830997

Please sign in to comment.