Skip to content

Commit

Permalink
Moved lints to Cargo.toml.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium committed Nov 28, 2023
1 parent c59a89c commit 5d0707b
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 28 deletions.
23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,29 @@ compiletest_rs = "0.10.2"
fatal-warnings = []
triomphe = ["dep:triomphe"]

[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
correctness = "deny"

explicit-deref-methods = "allow"
if-not-else = "allow"
inline-always = "allow"
match-bool = "allow"
missing-errors-doc = "allow"
missing-safety-doc = "allow"
module-name-repetitions = "allow"
partialeq-ne-impl = "allow"
similar-names = "allow"
single-match-else = "allow"
use-self = "allow"
wildcard-imports = "allow"

[lints.rustdoc]
# TODO This is only needed because `cargo-rdme` requires a path like `crate::⋯`. Once that limitation is lifted we
# can remove this.
redundant-explicit-links = "allow"

[[bench]]
name = "std_rc"
path = "benches/std_rc.rs"
Expand Down
4 changes: 2 additions & 2 deletions benches/archery_shared_pointer_arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn archery_shared_pointer_arc_deref(c: &mut Criterion) {
}

rc
})
});
});
}

Expand All @@ -37,7 +37,7 @@ fn archery_shared_pointer_arc_clone(c: &mut Criterion) {
vec.resize(limit, SharedPointer::<_, ArcK>::new(42));
vec
},
)
);
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/archery_shared_pointer_arct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn archery_shared_pointer_arct_deref(c: &mut Criterion) {
}

rc
})
});
});
}

Expand All @@ -37,7 +37,7 @@ fn archery_shared_pointer_arct_clone(c: &mut Criterion) {
vec.resize(limit, SharedPointer::<_, ArcTK>::new(42));
vec
},
)
);
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/archery_shared_pointer_rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn archery_shared_pointer_rc_deref(c: &mut Criterion) {
}

rc
})
});
});
}

Expand All @@ -37,7 +37,7 @@ fn archery_shared_pointer_rc_clone(c: &mut Criterion) {
vec.resize(limit, SharedPointer::<_, RcK>::new(42));
vec
},
)
);
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/std_arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn std_arc_deref(c: &mut Criterion) {
}

rc
})
});
});
}

Expand All @@ -37,7 +37,7 @@ fn std_arc_clone(c: &mut Criterion) {
vec.resize(limit, Arc::new(42));
vec
},
)
);
});
}

Expand Down
4 changes: 2 additions & 2 deletions benches/std_rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn std_rc_deref(c: &mut Criterion) {
}

rc
})
});
});
}

Expand All @@ -37,7 +37,7 @@ fn std_rc_clone_and_drop(c: &mut Criterion) {
vec.resize(limit, Rc::new(42));
vec
},
)
);
});
}

Expand Down
16 changes: 0 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@

#![no_std]
#![cfg_attr(feature = "fatal-warnings", deny(warnings))]
#![deny(clippy::correctness)]
#![warn(clippy::pedantic)]
#![allow(clippy::match_bool)]
#![allow(clippy::if_not_else)]
#![allow(clippy::module_name_repetitions)]
#![allow(clippy::similar_names)]
#![allow(clippy::use_self)]
#![allow(clippy::single_match_else)]
#![allow(clippy::inline_always)]
#![allow(clippy::partialeq_ne_impl)]
#![allow(clippy::missing_errors_doc)]
#![allow(clippy::explicit_deref_methods)]
#![allow(clippy::missing_safety_doc)]
// TODO This is only needed because `cargo-rdme` requires a path like `crate::⋯`. Once that limitation is
// lifted we can remove this.
#![allow(rustdoc::redundant_explicit_links)]
// Note: If you change this remember to update `README.md`. To do so run `cargo rdme`.
//! `archery` is a rust library that offers a way to abstraction over
//! [`Rc`](::alloc::rc::Rc) and
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ extern crate compiletest_rs as compiletest;

use std::path::{Path, PathBuf};

#[allow(clippy::case_sensitive_file_extension_comparisons)]
fn find_rlib(dependency_path: &Path, dependency_name: &str) -> std::io::Result<Option<PathBuf>> {
use std::fs::read_dir;

for entry in read_dir(dependency_path)? {
let entry = entry?;

if let Some(filename) = entry.path().file_name().and_then(|f| f.to_str()) {
if filename.starts_with(&format!("lib{}", dependency_name))
&& filename.ends_with(".rlib")
if filename.starts_with(&format!("lib{dependency_name}")) && filename.ends_with(".rlib")
{
return Ok(Some(entry.path()));
}
Expand Down

0 comments on commit 5d0707b

Please sign in to comment.