Skip to content

Commit baa8540

Browse files
committed
clippy: remove unnecessary ownership passing
1 parent e39c2b7 commit baa8540

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ impl Keyring {
421421
/// If the kernel returns malformed data, the the parser will panic.
422422
pub fn description(&self) -> Result<Description> {
423423
self.description_raw()
424-
.and_then(|desc| Description::parse(desc).ok_or(errno::Errno(libc::EINVAL)))
424+
.and_then(|desc| Description::parse(&desc).ok_or(errno::Errno(libc::EINVAL)))
425425
}
426426

427427
/// Set an expiration timer on the keyring to `timeout`.
@@ -617,7 +617,7 @@ pub struct Description {
617617
}
618618

619619
impl Description {
620-
fn parse(desc: String) -> Option<Description> {
620+
fn parse(desc: &str) -> Option<Description> {
621621
let mut pieces = desc.split(';').collect::<Vec<_>>();
622622
// Reverse the string because the kernel plans to extend it by adding fields to the
623623
// beginning of the string. By doing this, the fields are at a constant position in the

0 commit comments

Comments
 (0)