diff --git a/Cargo.toml b/Cargo.toml index fb0fb64bf..119546f15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,10 +19,12 @@ unused_qualifications = "warn" [workspace.lints.clippy] pedantic = { level = "warn", priority = -1 } derive_partial_eq_without_eq = "allow" +enum_variant_names = "allow" implicit_hasher = "allow" missing_errors_doc = "allow" missing_panics_doc = "allow" module_name_repetitions = "allow" +struct_field_names = "allow" [workspace.dependencies] actix-cors = "0.7" diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..cda8d17ee --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +avoid-breaking-exported-api = false diff --git a/martin/src/config.rs b/martin/src/config.rs index 0715e08b1..49d454e52 100644 --- a/martin/src/config.rs +++ b/martin/src/config.rs @@ -85,16 +85,16 @@ impl Config { } #[cfg(feature = "pmtiles")] - res.extend(self.pmtiles.finalize("pmtiles.")?); + res.extend(self.pmtiles.finalize("pmtiles.")); #[cfg(feature = "mbtiles")] - res.extend(self.mbtiles.finalize("mbtiles.")?); + res.extend(self.mbtiles.finalize("mbtiles.")); #[cfg(feature = "cog")] - res.extend(self.cog.finalize("cog.")?); + res.extend(self.cog.finalize("cog.")); #[cfg(feature = "sprites")] - res.extend(self.sprites.finalize("sprites.")?); + res.extend(self.sprites.finalize("sprites.")); // TODO: support for unrecognized fonts? // res.extend(self.fonts.finalize("fonts.")?); diff --git a/martin/src/file_config.rs b/martin/src/file_config.rs index 050a86fae..56a1062af 100644 --- a/martin/src/file_config.rs +++ b/martin/src/file_config.rs @@ -159,12 +159,12 @@ impl FileConfigEnum { Ok(Some(res)) } - pub fn finalize(&self, prefix: &str) -> MartinResult { + pub fn finalize(&self, prefix: &str) -> UnrecognizedValues { let mut res = UnrecognizedValues::new(); if let Self::Config(cfg) = self { copy_unrecognized_config(&mut res, prefix, cfg.get_unrecognized()); } - Ok(res) + res } } diff --git a/martin/src/mbtiles/mod.rs b/martin/src/mbtiles/mod.rs index 31e6768d8..50d58ae07 100644 --- a/martin/src/mbtiles/mod.rs +++ b/martin/src/mbtiles/mod.rs @@ -151,7 +151,7 @@ mod tests { path: https://example.org/file4.ext "}) .unwrap(); - let res = cfg.finalize("").unwrap(); + let res = cfg.finalize(""); assert!(res.is_empty(), "unrecognized config: {res:?}"); let FileConfigEnum::Config(cfg) = cfg else { panic!(); diff --git a/mbtiles/src/copier.rs b/mbtiles/src/copier.rs index c3200c350..e7bc9bbea 100644 --- a/mbtiles/src/copier.rs +++ b/mbtiles/src/copier.rs @@ -38,7 +38,7 @@ pub enum CopyDuplicateMode { impl CopyDuplicateMode { #[must_use] - pub fn to_sql(&self) -> &'static str { + pub fn to_sql(self) -> &'static str { match self { CopyDuplicateMode::Override => "OR REPLACE", CopyDuplicateMode::Ignore => "OR IGNORE", diff --git a/mbtiles/src/mbtiles.rs b/mbtiles/src/mbtiles.rs index c0cc920fa..40ece9757 100644 --- a/mbtiles/src/mbtiles.rs +++ b/mbtiles/src/mbtiles.rs @@ -35,11 +35,11 @@ pub enum CopyType { impl CopyType { #[must_use] - pub fn copy_tiles(&self) -> bool { + pub fn copy_tiles(self) -> bool { matches!(self, Self::All | Self::Tiles) } #[must_use] - pub fn copy_metadata(&self) -> bool { + pub fn copy_metadata(self) -> bool { matches!(self, Self::All | Self::Metadata) } } diff --git a/mbtiles/src/validation.rs b/mbtiles/src/validation.rs index 8a3dbdf51..1c90cddf1 100644 --- a/mbtiles/src/validation.rs +++ b/mbtiles/src/validation.rs @@ -41,12 +41,12 @@ pub enum MbtType { impl MbtType { #[must_use] - pub fn is_normalized(&self) -> bool { + pub fn is_normalized(self) -> bool { matches!(self, Self::Normalized { .. }) } #[must_use] - pub fn is_normalized_with_view(&self) -> bool { + pub fn is_normalized_with_view(self) -> bool { matches!(self, Self::Normalized { hash_view: true }) } }