Skip to content

Commit b96a2fb

Browse files
committed
chore: cargo clippy, round 1
Signed-off-by: Sam Gammon <[email protected]>
1 parent f9e4556 commit b96a2fb

File tree

8 files changed

+13
-15
lines changed

8 files changed

+13
-15
lines changed

crates/nassun/src/resolver.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ impl PackageResolver {
198198
&& tag_version.is_some()
199199
&& packument
200200
.versions
201-
.get(tag_version.as_ref().unwrap())
202-
.is_some()
201+
.contains_key(tag_version.as_ref().unwrap())
203202
&& match spec {
204203
PackageSpec::Npm {
205204
requested: None, ..

crates/node-maintainer/src/into_kdl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ pub trait IntoKdl: IntoKdlSealed {}
66

77
impl IntoKdl for KdlDocument {}
88
impl IntoKdl for String {}
9-
impl<'a> IntoKdl for &'a str {}
10-
impl<'a> IntoKdl for &'a String {}
9+
impl IntoKdl for & str {}
10+
impl IntoKdl for & String {}
1111

1212
impl IntoKdlSealed for KdlDocument {
1313
fn into_kdl(self) -> Result<KdlDocument, NodeMaintainerError> {
@@ -21,13 +21,13 @@ impl IntoKdlSealed for String {
2121
}
2222
}
2323

24-
impl<'a> IntoKdlSealed for &'a str {
24+
impl IntoKdlSealed for & str {
2525
fn into_kdl(self) -> Result<KdlDocument, NodeMaintainerError> {
2626
Ok(self.parse()?)
2727
}
2828
}
2929

30-
impl<'a> IntoKdlSealed for &'a String {
30+
impl IntoKdlSealed for & String {
3131
fn into_kdl(self) -> Result<KdlDocument, NodeMaintainerError> {
3232
Ok(self.parse()?)
3333
}

crates/node-maintainer/src/linkers/isolated.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,12 @@ impl IsolatedLinker {
105105
let expected_mut = &mut expected;
106106
let store_ref = &store;
107107
// Clean out individual node_modules within
108-
let indices = graph.inner.node_indices().map(move |idx| {
108+
let indices = graph.inner.node_indices().inspect(move |&idx| {
109109
if idx != graph.root {
110110
let pkg_store_dir = store_ref.join(package_dir_name(graph, idx));
111111

112112
expected_mut.insert(pkg_store_dir);
113113
}
114-
idx
115114
});
116115

117116
let prefix_ref = &prefix;
@@ -572,7 +571,7 @@ impl IsolatedLinker {
572571
let node_path = store_ref
573572
.join(package_dir_name(graph, node))
574573
.join("node_modules")
575-
.join(&graph[node].name.to_string());
574+
.join(graph[node].name.to_string());
576575
let build_mani = BuildManifest::from_path(node_path.join("package.json")).map_err(|e| {
577576
NodeMaintainerError::BuildManifestReadError(node_path.join("package.json"), e)
578577
})?;
@@ -584,7 +583,7 @@ impl IsolatedLinker {
584583
store_ref
585584
.join(package_dir_name(graph, edge.source()))
586585
.join("node_modules")
587-
.join(&dep_node.name.to_string())
586+
.join(dep_node.name.to_string())
588587
};
589588
let dep_bin_dir = dep_store_dir.join("node_modules").join(".bin");
590589
for (name, path) in &build_mani.bin {

crates/node-maintainer/src/resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub(crate) struct Resolver<'a> {
4848
pub(crate) on_resolve_progress: Option<ProgressHandler>,
4949
}
5050

51-
impl<'a> Resolver<'a> {
51+
impl Resolver<'_> {
5252
pub(crate) async fn run_resolver(
5353
mut self,
5454
lockfile: Option<Lockfile>,

crates/oro-config/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl OroConfigLayerExt for Command {
6161
let matches = self
6262
.clone()
6363
.ignore_errors(true)
64-
.get_matches_from(&args.clone());
64+
.get_matches_from(args.clone());
6565
for opt in long_opts {
6666
// TODO: _prepend_ args unconditionally if they're coming from
6767
// config, so multi-args get parsed right. Right now, if you have

crates/oro-script/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct OroScript<'a> {
2121
workspace_path: Option<PathBuf>,
2222
}
2323

24-
impl<'a> OroScript<'a> {
24+
impl OroScript<'_> {
2525
pub fn new(package_path: impl AsRef<Path>, event: impl AsRef<str>) -> Result<Self> {
2626
let package_path = package_path.as_ref();
2727
let package_path = dunce::canonicalize(package_path).io_context(|| format!("Failed to canonicalize package path at {} while preparing to run a package script.", package_path.display()))?;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ impl Orogene {
609609
if let Some(dsn) = self
610610
.sentry_dsn
611611
.as_deref()
612-
.or_else(|| option_env!("OROGENE_SENTRY_DSN"))
612+
.or(option_env!("OROGENE_SENTRY_DSN"))
613613
{
614614
let ret = sentry::init(
615615
sentry::ClientOptions {

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ use orogene::Orogene;
33

44
#[async_std::main]
55
async fn main() -> Result<()> {
6-
Ok(Orogene::load().await?)
6+
Orogene::load().await
77
}

0 commit comments

Comments
 (0)