clippy fix

This commit is contained in:
Jörn-Michael Miehe 2025-07-15 14:55:29 +00:00
parent 147c78377a
commit aa76c7efda
2 changed files with 7 additions and 2 deletions

View file

@ -43,18 +43,22 @@ impl Parameter {
self.is_uri() || self.is_alias_id() self.is_uri() || self.is_alias_id()
} }
#[must_use]
pub fn is_uri(&self) -> bool { pub fn is_uri(&self) -> bool {
matches!(self, Self::Uri(_)) matches!(self, Self::Uri(_))
} }
#[must_use]
pub fn is_alias_id(&self) -> bool { pub fn is_alias_id(&self) -> bool {
matches!(self, Self::AliasID(_)) matches!(self, Self::AliasID(_))
} }
#[must_use]
pub fn is_share_id(&self) -> bool { pub fn is_share_id(&self) -> bool {
matches!(self, Self::ShareID(_)) matches!(self, Self::ShareID(_))
} }
#[must_use]
pub fn is_file_id(&self) -> bool { pub fn is_file_id(&self) -> bool {
matches!(self, Self::FileID(_)) matches!(self, Self::FileID(_))
} }
@ -139,6 +143,7 @@ impl Error {
}) })
} }
#[must_use]
pub fn is_stdio_kind(&self, kind: std::io::ErrorKind) -> bool { pub fn is_stdio_kind(&self, kind: std::io::ErrorKind) -> bool {
if let Self::StdIo(e) = self { if let Self::StdIo(e) = self {
e.kind() == kind e.kind() == kind

View file

@ -222,7 +222,7 @@ mod tests {
let share_ids: [_; 10] = std::array::from_fn(|_| add_share(&client)); let share_ids: [_; 10] = std::array::from_fn(|_| add_share(&client));
for share_id in share_ids.as_ref() { for share_id in share_ids.as_ref() {
let res = client.insert_share(&share_id, MockShare::default()); let res = client.insert_share(share_id, MockShare::default());
assert!(res.is_err()); assert!(res.is_err());
assert!(res.unwrap_err().response_contains("can't insert share")); assert!(res.unwrap_err().response_contains("can't insert share"));
} }
@ -290,7 +290,7 @@ mod tests {
let file_ids: [_; 10] = std::array::from_fn(|_| add_file(&client, &share_id)); let file_ids: [_; 10] = std::array::from_fn(|_| add_file(&client, &share_id));
for file_id in file_ids.as_ref() { for file_id in file_ids.as_ref() {
let res = client.insert_file(&share_id, &file_id, MockFile::default()); let res = client.insert_file(&share_id, file_id, MockFile::default());
assert!(res.is_err()); assert!(res.is_err());
assert!(res.unwrap_err().response_contains("can't insert file")); assert!(res.unwrap_err().response_contains("can't insert file"));
} }