refactor: apply clippy lints

This commit is contained in:
daimond113 2025-03-08 22:37:42 +01:00
parent ff5c2e5d61
commit c7a8f919e2
No known key found for this signature in database
GPG key ID: 640DC95EC1190354
9 changed files with 11 additions and 12 deletions

View file

@ -40,7 +40,7 @@ async fn read_dir_stream(
async fn get_nlinks(path: &Path) -> anyhow::Result<u64> {
#[cfg(unix)]
{
use std::os::unix::fs::MetadataExt;
use std::os::unix::fs::MetadataExt as _;
let metadata = fs::metadata(path).await?;
return Ok(metadata.nlink());
}

View file

@ -59,12 +59,12 @@ impl SelfInstallCommand {
#[cfg(unix)]
{
println!(
r#"installed {} {}! add the following line to your shell profile in order to get the binary and binary exports as executables usable from anywhere:
r"installed {} {}! add the following line to your shell profile in order to get the binary and binary exports as executables usable from anywhere:
{}
and then restart your shell.
"#,
",
CLI_STYLE.apply_to(env!("CARGO_BIN_NAME")),
ADDED_STYLE.apply_to(env!("CARGO_PKG_VERSION")),
style(format!(r#"export PATH="$PATH:$HOME/{HOME_DIR}/bin""#)).green(),

View file

@ -3,9 +3,9 @@ use std::path::Path;
pub async fn make_executable<P: AsRef<Path>>(_path: P) -> anyhow::Result<()> {
#[cfg(unix)]
{
use anyhow::Context;
use anyhow::Context as _;
use fs_err::tokio as fs;
use std::os::unix::fs::PermissionsExt;
use std::os::unix::fs::PermissionsExt as _;
let mut perms = fs::metadata(&_path)
.await

View file

@ -1,5 +1,4 @@
#![warn(missing_docs)]
#![deny(clippy::future_not_send)]
//! A package manager for the Luau programming language, supporting multiple runtimes including Roblox and Lune.
//! pesde has its own registry, however it can also use Wally, and Git repositories as package sources.
//! It has been designed with multiple targets in mind, namely Roblox, Lune, and Luau.

View file

@ -197,7 +197,7 @@ impl schemars::JsonSchema for Alias {
fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::json_schema!({
"type": "string",
"pattern": r#"^[a-zA-Z0-9_-]+$"#,
"pattern": r"^[a-zA-Z0-9_-]+$",
})
}
}

View file

@ -41,7 +41,7 @@ impl schemars::JsonSchema for OverrideKey {
fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::json_schema!({
"type": "string",
"pattern": r#"^(?:[a-zA-Z0-9_-]+>[a-zA-Z0-9_-]+(?:>[a-zA-Z0-9_-]+)*)(?:,(?:[a-zA-Z0-9_-]+>[a-zA-Z0-9_-]+(?:>[a-zA-Z0-9_-]+)*))*$"#,
"pattern": r"^(?:[a-zA-Z0-9_-]+>[a-zA-Z0-9_-]+(?:>[a-zA-Z0-9_-]+)*)(?:,(?:[a-zA-Z0-9_-]+>[a-zA-Z0-9_-]+(?:>[a-zA-Z0-9_-]+)*))*$",
})
}
}

View file

@ -81,7 +81,7 @@ impl schemars::JsonSchema for PackageName {
fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::json_schema!({
"type": "string",
"pattern": r#"^(?!_)(?![0-9]+\/)[a-z0-9_]{3,32}(?<!_)\/(?!_)(?![0-9]+\/)[a-z0-9_]{1,32}(?<!_)$"#
"pattern": r"^(?!_)(?![0-9]+\/)[a-z0-9_]{3,32}(?<!_)\/(?!_)(?![0-9]+\/)[a-z0-9_]{1,32}(?<!_)$"
})
}
}
@ -260,7 +260,7 @@ pub mod wally {
fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
schemars::json_schema!({
"type": "string",
"pattern": r#"^(wally#)?[a-z0-9-]{1,64}\/[a-z0-9-]{1,64}$"#
"pattern": r"^(wally#)?[a-z0-9-]{1,64}\/[a-z0-9-]{1,64}$"
})
}
}

View file

@ -60,7 +60,7 @@ async fn set_readonly(path: &Path, readonly: bool) -> std::io::Result<()> {
#[cfg(unix)]
{
use std::os::unix::fs::PermissionsExt;
use std::os::unix::fs::PermissionsExt as _;
permissions.set_mode(permissions.mode() | 0o644);
}
}

View file

@ -89,7 +89,7 @@ impl schemars::JsonSchema for VersionId {
schemars::json_schema!({
"type": "string",
"pattern": format!(r#"^({version_pattern}) ({target_pattern})$"#),
"pattern": format!(r"^({version_pattern}) ({target_pattern})$"),
})
}
}