From 3f430b5d32418b0b7ac93502113ee59009f4583f Mon Sep 17 00:00:00 2001 From: Schneems Date: Tue, 30 Jul 2024 12:29:36 -0500 Subject: [PATCH 1/2] Fixup lazy continuation https://rust-lang.github.io/rust-clippy/master/index.html#/doc_lazy_continuation --- commons/src/cache/app_cache.rs | 10 +++++----- commons/src/cache/clean.rs | 2 +- commons/src/output/section_log.rs | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/commons/src/cache/app_cache.rs b/commons/src/cache/app_cache.rs index 994f4448..8fa64d55 100644 --- a/commons/src/cache/app_cache.rs +++ b/commons/src/cache/app_cache.rs @@ -83,9 +83,9 @@ impl AppCache { /// # Errors /// /// - If the cache or applications directory cannot be created - /// (possibly due to permissions error). + /// (possibly due to permissions error). /// - If files from the cache cannot be loaded into the - /// application directory (possibly due to permissions error). + /// application directory (possibly due to permissions error). /// - Internal errors from libcnb layer creation and execution. pub fn new_and_load( context: &BuildContext, @@ -124,7 +124,7 @@ impl AppCache { /// # Errors /// /// - If the files cannot be moved/coppied into the cache - /// then then an error will be raised. + /// then then an error will be raised. pub fn save(&self) -> Result<&AppCache, CacheError> { match self.keep_path { KeepPath::Runtime => preserve_path_save(self)?, @@ -143,7 +143,7 @@ impl AppCache { /// # Errors /// /// - If files cannot be moved from the cache to the path - /// then an error will be raised. + /// then an error will be raised. pub fn load(&self) -> Result<&Self, CacheError> { fs_err::create_dir_all(&self.path).map_err(CacheError::IoError)?; fs_err::create_dir_all(&self.cache).map_err(CacheError::IoError)?; @@ -186,7 +186,7 @@ impl AppCache { /// /// - If files cannot be deleted an error will be raised /// - If the operating system does not support the `mtime` an - /// error will be raised. + /// error will be raised. /// - If metadata of a file cannot be read, an error will be raised pub fn save_and_clean(&self) -> Result, CacheError> { self.save()?; diff --git a/commons/src/cache/clean.rs b/commons/src/cache/clean.rs index 0891b00d..a35f43e4 100644 --- a/commons/src/cache/clean.rs +++ b/commons/src/cache/clean.rs @@ -15,7 +15,7 @@ use std::time::SystemTime; /// /// - The provided ``cache_path`` is not valid UTF-8 (`OsStringErr`). /// - Metadata from a file in the ``cache_path`` cannot be retrieved from the OS (`IoError`). -/// this is needed for mtime retrieval to calculate which file is least recently used. +/// this is needed for mtime retrieval to calculate which file is least recently used. /// - If there's an OS error while deleting a file. /// - If an internal glob pattern is incorrect /// - If the OS does not support mtime operation on files. diff --git a/commons/src/output/section_log.rs b/commons/src/output/section_log.rs index 29ed49eb..654d9c64 100644 --- a/commons/src/output/section_log.rs +++ b/commons/src/output/section_log.rs @@ -13,9 +13,9 @@ use std::marker::PhantomData; /// only downside is that the buildpack author (you) is now responsible for: /// /// - Ensuring that `Box::section()` was called right before any of these -/// functions are called. +/// functions are called. /// - Ensuring that you are not attempting to log while already logging i.e. calling `step()` within a -/// `step_timed()` call. +/// `step_timed()` call. /// /// For usage details run `cargo run --bin print_style_guide` /// From 87c5302be420e394d3d8a2cbb6dc95df82ab6b79 Mon Sep 17 00:00:00 2001 From: Schneems Date: Tue, 30 Jul 2024 16:54:21 -0500 Subject: [PATCH 2/2] Update warning priority --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 37969616..1d9f1ee8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ unused_crate_dependencies = "warn" [workspace.lints.clippy] panic_in_result_fn = "warn" -pedantic = "warn" +# The explicit priority is required due to https://github.com/rust-lang/cargo/issues/13565. +pedantic = { level = "warn", priority = -1 } unwrap_used = "warn" module_name_repetitions = "allow"