diff --git a/cli/src/fragment.rs b/cli/src/fragment.rs index 8400bc7..39ce094 100644 --- a/cli/src/fragment.rs +++ b/cli/src/fragment.rs @@ -17,16 +17,20 @@ impl Builder { } } - pub fn needs_password(mut self) -> Self { + pub const fn needs_password(mut self) -> Self { self.needs_password = true; self } + // False positive + #[allow(clippy::missing_const_for_fn)] pub fn file_name(mut self, name: String) -> Self { self.file_name = Some(name); self } + // False positive + #[allow(clippy::missing_const_for_fn)] pub fn language(mut self, language: String) -> Self { self.language = Some(language); self diff --git a/cli/src/main.rs b/cli/src/main.rs index f9b5631..100431f 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -160,7 +160,7 @@ fn handle_upload( fragment = fragment.language(language); } - url.set_fragment(Some(&fragment.build().expose_secret())); + url.set_fragment(Some(fragment.build().expose_secret())); println!("{url}"); diff --git a/web/src/decrypt.rs b/web/src/decrypt.rs index c6ba39d..c8ac298 100644 --- a/web/src/decrypt.rs +++ b/web/src/decrypt.rs @@ -159,11 +159,10 @@ fn guess_mime_type(name_hint: Option<&str>, data: &[u8]) -> &'static str { // support. As a result, we can probably just get the first one. log!("[rs] Mime type inferred from extension."); return mime_type; - } else { - log!("[rs] No mime type found for extension, falling back to introspection."); } + log!("[rs] No mime type found for extension, falling back to introspection."); } - tree_magic_mini::from_u8(&data) + tree_magic_mini::from_u8(data) } #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)]