Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.92.0"
channel = "1.97.1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: 1.98.0 shipped 2026-08-18, so "the current stable release" in the description is now one behind. Pinning one release back is defensible — just noting the wording no longer matches if landing on current stable was the intent.

components = ["clippy", "rustfmt"]
targets = ["x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-unknown-linux-gnu"]
10 changes: 3 additions & 7 deletions src/packs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ pub fn create(
) -> anyhow::Result<()> {
match creator::create(configuration, &name)? {
CreateResult::AlreadyExists => {
println!("`{}` already exists!", &name);
println!("`{}` already exists!", name);
}
CreateResult::Success => {
println!("Successfully created `{}`!", &name);
println!("Successfully created `{}`!", name);
}
}
Ok(())
Expand Down Expand Up @@ -246,11 +246,7 @@ pub fn lint_package_yml_files(
pub fn delete_cache(configuration: Configuration) {
let absolute_cache_dir = configuration.cache_directory;
if let Err(err) = std::fs::remove_dir_all(&absolute_cache_dir) {
eprintln!(
"Failed to remove {}: {}",
&absolute_cache_dir.display(),
err
);
eprintln!("Failed to remove {}: {}", absolute_cache_dir.display(), err);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/packs/checker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ impl<'a> CheckAllBuilder<'a> {
.map_err(|e| {
anyhow::Error::new(e).context(format!(
"Failed to strip prefix from {:?}",
&self.configuration.absolute_root
self.configuration.absolute_root
))
})
.and_then(|path| {
path.to_str().ok_or_else(|| {
anyhow::Error::new(std::fmt::Error).context(
format!(
"Path ({:?}) cannot be converted to &str",
&path
path
),
)
})
Expand Down Expand Up @@ -314,7 +314,7 @@ pub(crate) fn update(configuration: &Configuration) -> anyhow::Result<()> {
}
println!(
"{} strict mode violation(s) detected. These violations must be fixed for `check` to succeed.",
&strict_violations.len()
strict_violations.len()
);
}
package_todo::write_violations_to_disk(configuration, violations);
Expand Down
2 changes: 1 addition & 1 deletion src/packs/checker/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Checker {
} else {
Some(format!(
"Invalid 'layer' option in '{}'. `layer` must be one of the layers defined in `packwerk.yml`",
&pack.relative_yml().to_string_lossy()
pack.relative_yml().to_string_lossy()
))
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/packs/checker/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Reference {
.for_pack(name)
.context(format!(
"Reference#defining_pack_name is {}, but that pack is not found in pack set.",
&name
name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flagging this one site as the one worth actually reading rather than skimming, since it isn't the simple case the rest of the diff is.

name is bound by if let Some(name) = &self.defining_pack_name over an Option<String> field, so name is already &String — meaning the original format!(..., &name) was &&String, a double borrow, not the single &x -> x the description describes.

It is still correct to remove it: the blanket impl<T: Display + ?Sized> Display for &T makes Display transparent through any depth of references, so the formatted output is byte-identical. No change needed. Noting it only because a mechanical &-strip is exactly the kind of edit where a nested borrow can hide a real change, and this is the site a reviewer should verify by hand.

))?))
} else {
Ok(None)
Expand All @@ -40,7 +40,7 @@ impl Reference {
) -> anyhow::Result<&'a Pack> {
pack_set.for_pack(&self.referencing_pack_name).
context(format!("Reference#referencing_pack_name is {}, but that pack is not found in pack set.",
&self.referencing_pack_name))
self.referencing_pack_name))
}
}

Expand All @@ -59,7 +59,7 @@ impl Reference {
Some(pack_name) => pack_name,
None => bail!(
"Could not find pack for referencing file path: {}",
&referencing_file_path.display()
referencing_file_path.display()
),
};

Expand Down
4 changes: 2 additions & 2 deletions src/packs/creator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ pub fn create(
.next_back()
.context("unable to find pack name")?;
std::fs::create_dir_all(new_pack_path.join("app/public/").join(pack_name))
.context(format!("failed to create app/public/{}", &name))?;
.context(format!("failed to create app/public/{}", name))?;
std::fs::create_dir_all(
new_pack_path.join("app/services/").join(pack_name),
)
.context(format!("failed to create app/services/{}", &name))?;
.context(format!("failed to create app/services/{}", name))?;
if is_rails(configuration) {
std::fs::create_dir_all(new_pack_path.join("app/controllers/"))
.context("failed to create app/controllers")?;
Expand Down
6 changes: 3 additions & 3 deletions src/packs/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,20 +428,20 @@ pub fn write_pack_to_disk(pack: &Pack) -> anyhow::Result<()> {
let pack_dir = pack.yml.parent().ok_or_else(|| {
anyhow::Error::new(std::io::Error::new(
std::io::ErrorKind::NotFound,
format!("Failed to get parent directory of pack {:?}", &pack.yml),
format!("Failed to get parent directory of pack {:?}", pack.yml),
))
})?;

std::fs::create_dir_all(pack_dir).map_err(|e| {
anyhow::Error::new(e).context(format!(
"Failed to create directory for pack {:?}",
&pack_dir
pack_dir
))
})?;

std::fs::write(&pack.yml, serialized_pack).map_err(|e| {
anyhow::Error::new(e)
.context(format!("Failed to write pack to disk {:?}", &pack.yml))
.context(format!("Failed to write pack to disk {:?}", pack.yml))
})?;

Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/packs/parsing/ruby/parse_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub fn get_reference_from_active_record_association(
// Later we should probably handle these cases!
if name.is_some() {
let unwrapped_name = name.unwrap_or_else(|| {
panic!("Could not find class name for association {:?}", &node,)
panic!("Could not find class name for association {:?}", node)
});

Some(UnresolvedReference {
Expand Down
2 changes: 1 addition & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn teardown() {
if let Err(err) = fs::remove_dir_all(&cache_dir) {
eprintln!(
"Failed to remove {} during test teardown: {}",
&cache_dir.display(),
cache_dir.display(),
err
);
}
Expand Down
Loading