commit 6cf46843654fe007aadcd101675f977dc83fcac6
parent a5c3c81888cf294b5863a5827663ff349b0a6788
Author: Zack Newman <zack@philomathiclife.com>
Date: Mon, 23 Jun 2025 13:26:08 -0600
more lints
Diffstat:
3 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
@@ -6,10 +6,53 @@ edition = "2024"
keywords = ["git", "stagit"]
license = "MIT OR Apache-2.0"
name = "git_index"
+publish = false
readme = "README.md"
repository = "https://git.philomathiclife.com/repos/git_index/"
rust-version = "1.86.0"
-version = "0.1.7"
+version = "0.1.8"
+
+[lints.rust]
+ambiguous_negative_literals = { level = "deny", priority = -1 }
+closure_returning_async_block = { level = "deny", priority = -1 }
+deref_into_dyn_supertrait = { level = "deny", priority = -1 }
+ffi_unwind_calls = { level = "deny", priority = -1 }
+future_incompatible = { level = "deny", priority = -1 }
+impl_trait_redundant_captures = { level = "deny", priority = -1 }
+keyword-idents = { level = "deny", priority = -1 }
+let_underscore = { level = "deny", priority = -1 }
+linker_messages = { level = "deny", priority = -1 }
+macro_use_extern_crate = { level = "deny", priority = -1 }
+meta_variable_misuse = { level = "deny", priority = -1 }
+missing_copy_implementations = { level = "deny", priority = -1 }
+missing_debug_implementations = { level = "deny", priority = -1 }
+missing_docs = { level = "deny", priority = -1 }
+non_ascii_idents = { level = "deny", priority = -1 }
+nonstandard_style = { level = "deny", priority = -1 }
+redundant_imports = { level = "deny", priority = -1 }
+redundant_lifetimes = { level = "deny", priority = -1 }
+refining_impl_trait = { level = "deny", priority = -1 }
+rust_2018_compatibility = { level = "deny", priority = -1 }
+rust_2018_idioms = { level = "deny", priority = -1 }
+rust_2021_compatibility = { level = "deny", priority = -1 }
+rust_2024_compatibility = { level = "deny", priority = -1 }
+single_use_lifetimes = { level = "deny", priority = -1 }
+trivial_casts = { level = "deny", priority = -1 }
+trivial_numeric_casts = { level = "deny", priority = -1 }
+unit_bindings = { level = "deny", priority = -1 }
+unknown_lints = { level = "deny", priority = -1 }
+unnameable_types = { level = "deny", priority = -1 }
+unreachable_pub = { level = "deny", priority = -1 }
+unsafe_code = { level = "deny", priority = -1 }
+unstable_features = { level = "deny", priority = -1 }
+unused = { level = "deny", priority = -1 }
+unused_crate_dependencies = { level = "deny", priority = -1 }
+unused_import_braces = { level = "deny", priority = -1 }
+unused_lifetimes = { level = "deny", priority = -1 }
+unused_qualifications = { level = "deny", priority = -1 }
+unused_results = { level = "deny", priority = -1 }
+variant_size_differences = { level = "deny", priority = -1 }
+warnings = { level = "deny", priority = -1 }
[lints.clippy]
all = { level = "deny", priority = -1 }
@@ -28,14 +71,16 @@ blanket_clippy_restriction_lints = "allow"
implicit_return = "allow"
min_ident_chars = "allow"
missing_trait_methods = "allow"
+pub_with_shorthand = "allow"
question_mark_used = "allow"
+redundant_pub_crate = "allow"
ref_patterns = "allow"
return_and_then = "allow"
single_call_fn = "allow"
[dependencies]
-jiff = { version = "0.2.13", default-features = false }
-priv_sep = { version = "3.0.0-alpha.1", default-features = false }
+jiff = { version = "0.2.15", default-features = false }
+priv_sep = { version = "3.0.0-alpha.1.1", default-features = false }
[profile.release]
lto = true
diff --git a/src/args.rs b/src/args.rs
@@ -1,5 +1,4 @@
use core::{
- convert::AsRef,
error::Error,
fmt::{self, Display, Formatter},
};
@@ -9,7 +8,7 @@ use std::{
};
/// Wrapper around an absolute [`PathBuf`] to a directory.
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
-pub struct AbsDirPath {
+pub(crate) struct AbsDirPath {
/// The directory.
path: PathBuf,
}
@@ -19,7 +18,7 @@ impl AbsDirPath {
/// If `PathBuf::from(val).as_bytes().last().unwrap() != b'/'`, `val`
/// will have `/` appended to it.
#[expect(clippy::option_if_let_else, reason = "can't without moving val")]
- pub fn from_string(val: String) -> Option<Self> {
+ pub(crate) fn from_string(val: String) -> Option<Self> {
match val.as_bytes().last() {
Some(byt) => {
let last = *byt;
@@ -42,7 +41,7 @@ impl AsRef<Path> for AbsDirPath {
}
/// Error returned when parsing arguments passed to the application.
#[derive(Debug)]
-pub enum ArgsErr {
+pub(crate) enum ArgsErr {
/// Error when no arguments were passed to the application.
NoArgs,
/// Error when an option was passed that was not an absolute file path to a directory.
@@ -61,7 +60,7 @@ impl Display for ArgsErr {
}
impl Error for ArgsErr {}
/// Returns `AbsDirPath` based on arguments passed to the application.
-pub fn from_env_args() -> Result<AbsDirPath, ArgsErr> {
+pub(crate) fn from_env_args() -> Result<AbsDirPath, ArgsErr> {
/// Attempts to parse the next `Arg` into an absolute path to a directory.
fn get_path(args: &mut Args) -> Result<AbsDirPath, ArgsErr> {
args.next()
diff --git a/src/main.rs b/src/main.rs
@@ -14,6 +14,8 @@ use core::{
str::{self, Utf8Error},
};
use jiff::{Error as TimeErr, Timestamp, fmt::temporal::DateTimeParser};
+#[cfg(not(target_os = "openbsd"))]
+use priv_sep as _;
#[cfg(target_os = "openbsd")]
use priv_sep::{NulOrIoErr, Permissions, Promise, Promises};
use std::{