Skip to content

Commit

Permalink
Use Rust's 1.74 cargo lint section
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Nov 16, 2023
1 parent 66eb925 commit ff33e14
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 13 deletions.
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ rust-version = "1.65"
readme = "README.md"
homepage = "https://martin.maplibre.org/"

[workspace.lints.rust]
unsafe_code = "forbid"

[workspace.lints.clippy]
pedantic = "warn"
derive_partial_eq_without_eq = "allow"
implicit_hasher = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"

[workspace.dependencies]
actix-cors = "0.6"
actix-http = "3"
Expand Down
2 changes: 2 additions & 0 deletions martin-tile-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
name = "martin-tile-utils"
version = "0.1.4"
Expand Down
2 changes: 1 addition & 1 deletion martin-tile-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ mod tests {
#[test]
fn test_data_format_webp() {
assert_eq!(detect("./fixtures/dc.webp"), info(Webp, Internal));
assert_eq!(TileInfo::detect(br#"RIFF"#), None);
assert_eq!(TileInfo::detect(br"RIFF"), None);
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions martin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
lints.workspace = true

[package]
name = "martin"
# Once the release is published with the hash, update https://github.com/maplibre/homebrew-martin
Expand Down
9 changes: 0 additions & 9 deletions martin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
#![doc = include_str!("../README.md")]
#![forbid(unsafe_code)]
#![warn(clippy::pedantic)]
// Bounds struct derives PartialEq, but not Eq,
// so all containing types must also derive PartialEq without Eq
#![allow(clippy::derive_partial_eq_without_eq)]
#![allow(clippy::implicit_hasher)]
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::missing_panics_doc)]
#![allow(clippy::module_name_repetitions)]

pub mod args;
mod config;
Expand Down
13 changes: 13 additions & 0 deletions mbtiles/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,16 @@ path = "src/lib.rs"
name = "mbtiles"
path = "src/bin/main.rs"
required-features = ["cli"]

# Lints inheritance from workspace is not yet supported
# Copy/pasting the list, modifying the `unsafe_code` requirement
[lints.rust]
unsafe_code = "allow"

[lints.clippy]
pedantic = "warn"
derive_partial_eq_without_eq = "allow"
implicit_hasher = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
1 change: 0 additions & 1 deletion mbtiles/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![doc = include_str!("../README.md")]
#![allow(clippy::missing_errors_doc)]

mod errors;
pub use errors::{MbtError, MbtResult};
Expand Down
2 changes: 0 additions & 2 deletions mbtiles/src/mbtiles.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::missing_errors_doc)]

use std::collections::HashSet;
use std::ffi::OsStr;
use std::fmt::{Display, Formatter};
Expand Down

0 comments on commit ff33e14

Please sign in to comment.