chore: Fix several style lints (#17488)

It's not comprehensive enough to start linting on `style` group, but
hey, it's a start.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-06 11:58:39 +02:00 committed by GitHub
parent 93249fc82b
commit e6c1c51b37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
361 changed files with 3530 additions and 3587 deletions

View file

@ -9,7 +9,7 @@ use crate::workspace::load_workspace;
pub struct LicensesArgs {}
pub fn run_licenses(_args: LicensesArgs) -> Result<()> {
const LICENSE_FILES: &[&'static str] = &["LICENSE-APACHE", "LICENSE-GPL", "LICENSE-AGPL"];
const LICENSE_FILES: &[&str] = &["LICENSE-APACHE", "LICENSE-GPL", "LICENSE-AGPL"];
let workspace = load_workspace()?;
@ -19,7 +19,7 @@ pub fn run_licenses(_args: LicensesArgs) -> Result<()> {
.parent()
.ok_or_else(|| anyhow!("no crate directory for {}", package.name))?;
if let Some(license_file) = first_license_file(&crate_dir, &LICENSE_FILES) {
if let Some(license_file) = first_license_file(crate_dir, LICENSE_FILES) {
if !license_file.is_symlink() {
println!("{} is not a symlink", license_file.display());
}

View file

@ -71,7 +71,7 @@ pub fn run_package_conformity(_args: PackageConformityArgs) -> Result<()> {
/// Returns the contents of the `Cargo.toml` file at the given path.
fn read_cargo_toml(path: impl AsRef<Path>) -> Result<Manifest> {
let path = path.as_ref();
let cargo_toml_bytes = fs::read(&path)?;
let cargo_toml_bytes = fs::read(path)?;
Manifest::from_slice(&cargo_toml_bytes)
.with_context(|| anyhow!("failed to read Cargo.toml at {path:?}"))
}