From 40bbba4fb18cde924b57258a5cdf524dcba4616d Mon Sep 17 00:00:00 2001 From: tottoto Date: Fri, 27 Dec 2024 06:32:04 +0900 Subject: [PATCH] chore: remove needless lifetime --- crates/volta-core/src/platform/mod.rs | 2 +- crates/volta-core/src/run/parser.rs | 10 +++++----- crates/volta-core/src/version/mod.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/volta-core/src/platform/mod.rs b/crates/volta-core/src/platform/mod.rs index 02b19489c..18558f4aa 100644 --- a/crates/volta-core/src/platform/mod.rs +++ b/crates/volta-core/src/platform/mod.rs @@ -89,7 +89,7 @@ impl Sourced { } } -impl<'a, T> Sourced<&'a T> +impl Sourced<&T> where T: Clone, { diff --git a/crates/volta-core/src/run/parser.rs b/crates/volta-core/src/run/parser.rs index 7e5b5c0d5..efc1b2e81 100644 --- a/crates/volta-core/src/run/parser.rs +++ b/crates/volta-core/src/run/parser.rs @@ -274,7 +274,7 @@ pub enum GlobalCommand<'a> { Upgrade(UpgradeArgs<'a>), } -impl<'a> GlobalCommand<'a> { +impl GlobalCommand<'_> { pub fn executor(self, platform: &PlatformSpec) -> Fallible { match self { GlobalCommand::Install(cmd) => cmd.executor(platform), @@ -294,7 +294,7 @@ pub struct InstallArgs<'a> { tools: Vec<&'a OsStr>, } -impl<'a> InstallArgs<'a> { +impl InstallArgs<'_> { /// Convert these global install arguments into an executor for the command /// /// If there are multiple packages specified to install, then they will be broken out into @@ -329,7 +329,7 @@ pub struct UninstallArgs<'a> { tools: Vec<&'a OsStr>, } -impl<'a> UninstallArgs<'a> { +impl UninstallArgs<'_> { /// Convert the tools into an executor for the uninstall command /// /// Since the packages are sandboxed, each needs to be uninstalled separately @@ -355,7 +355,7 @@ pub struct UpgradeArgs<'a> { tools: Vec<&'a OsStr>, } -impl<'a> UpgradeArgs<'a> { +impl UpgradeArgs<'_> { /// Convert these global upgrade arguments into an executor for the command /// /// If there are multiple packages specified to upgrade, then they will be broken out into @@ -428,7 +428,7 @@ pub struct LinkArgs<'a> { tools: Vec<&'a OsStr>, } -impl<'a> LinkArgs<'a> { +impl LinkArgs<'_> { pub fn executor(self, platform: Platform, project_name: Option) -> Fallible { if self.tools.is_empty() { // If no tools are specified, then this is a bare link command, linking the current diff --git a/crates/volta-core/src/version/mod.rs b/crates/volta-core/src/version/mod.rs index 00244c82b..7015b89d7 100644 --- a/crates/volta-core/src/version/mod.rs +++ b/crates/volta-core/src/version/mod.rs @@ -116,7 +116,7 @@ pub mod version_serde { struct VersionVisitor; - impl<'de> Visitor<'de> for VersionVisitor { + impl Visitor<'_> for VersionVisitor { type Value = Version; fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {