Skip to content

Commit df5aef6

Browse files
authored
Fix clippy warnings after rust update (#1790)
- **Clippy --fix** - **Elided lifetime has a name**
1 parent 121696d commit df5aef6

File tree

20 files changed

+28
-28
lines changed

20 files changed

+28
-28
lines changed

extensions/scarb-doc/src/docs_generation/markdown/traits.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ impl MarkdownDocItem for Trait {
212212
/// cthat share the same name.
213213
pub fn mark_duplicated_item_with_relative_path<'a, T: TopLevelMarkdownDocItem + 'a>(
214214
items: &'a [&'a T],
215-
) -> Vec<(&&'a T, Option<String>)> {
215+
) -> Vec<(&'a &'a T, Option<String>)> {
216216
let mut paths_for_item_name = HashMap::<String, Vec<String>>::new();
217217
for item in items {
218218
paths_for_item_name

scarb/src/core/checksum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl FromStr for Checksum {
6565
}
6666
}
6767

68-
impl<'a> TryFrom<&'a str> for Checksum {
68+
impl TryFrom<&str> for Checksum {
6969
type Error = anyhow::Error;
7070

7171
fn try_from(s: &str) -> Result<Self, Self::Error> {

scarb/src/core/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl Config {
182182
self.creation_time.elapsed()
183183
}
184184

185-
pub fn package_cache_lock<'a>(&'a self) -> &AdvisoryLock<'a> {
185+
pub fn package_cache_lock<'a>(&'a self) -> &'a AdvisoryLock<'a> {
186186
// UNSAFE: These mem::transmute calls only change generic lifetime parameters.
187187
let static_al: &AdvisoryLock<'static> = self.package_cache_lock.get_or_init(|| {
188188
let not_static_al =

scarb/src/core/registry/cache.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl<'a> RegistryCache<'a> {
3030
}
3131

3232
#[async_trait(?Send)]
33-
impl<'c> Registry for RegistryCache<'c> {
33+
impl Registry for RegistryCache<'_> {
3434
/// Attempt to find the packages that match dependency request.
3535
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
3636
self.queries.load(dependency.clone()).await

scarb/src/core/registry/client/http.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'c> HttpRegistryClient<'c> {
5757
}
5858

5959
#[async_trait]
60-
impl<'c> RegistryClient for HttpRegistryClient<'c> {
60+
impl RegistryClient for HttpRegistryClient<'_> {
6161
async fn get_records(
6262
&self,
6363
package: PackageName,

scarb/src/core/registry/patcher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl<'a> RegistryPatcher<'a> {
2222
}
2323

2424
#[async_trait(?Send)]
25-
impl<'a> Registry for RegistryPatcher<'a> {
25+
impl Registry for RegistryPatcher<'_> {
2626
#[tracing::instrument(skip_all)]
2727
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
2828
let patch = self.patch_map.lookup(dependency);

scarb/src/core/registry/source_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'c> SourceMap<'c> {
5757
}
5858

5959
#[async_trait(?Send)]
60-
impl<'c> Registry for SourceMap<'c> {
60+
impl Registry for SourceMap<'_> {
6161
/// Attempt to find the packages that match a dependency request.
6262
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
6363
let source = self.ensure_loaded(dependency.source_id).await?;

scarb/src/core/workspace.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn check_unique_targets(targets: &Vec<&Target>) -> Result<()> {
221221
Ok(())
222222
}
223223

224-
impl<'c> fmt::Display for Workspace<'c> {
224+
impl fmt::Display for Workspace<'_> {
225225
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
226226
let manifest_path = self.manifest_path();
227227
let path = if manifest_path.file_name() == Some(MANIFEST_FILE_NAME) {
@@ -233,7 +233,7 @@ impl<'c> fmt::Display for Workspace<'c> {
233233
}
234234
}
235235

236-
impl<'c> fmt::Debug for Workspace<'c> {
236+
impl fmt::Debug for Workspace<'_> {
237237
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
238238
f.debug_struct("Workspace")
239239
.field("members", &self.members)
@@ -251,7 +251,7 @@ impl Utf8PathWorkspaceExt for Utf8Path {
251251
}
252252
}
253253

254-
impl<'c> PackagesSource for Workspace<'c> {
254+
impl PackagesSource for Workspace<'_> {
255255
type Package = Package;
256256

257257
fn package_name_of(package: &Self::Package) -> &str {

scarb/src/internal/to_version.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ impl ToVersion for Version {
1111
}
1212
}
1313

14-
impl<'a> ToVersion for &'a str {
14+
impl ToVersion for &str {
1515
fn to_version(self) -> Result<Version> {
1616
Version::parse(self.trim())
1717
.map_err(|_| anyhow::format_err!("cannot parse '{}' as a semver", self))
1818
}
1919
}
2020

21-
impl<'a> ToVersion for &'a String {
21+
impl ToVersion for &String {
2222
fn to_version(self) -> Result<Version> {
2323
(**self).to_version()
2424
}
2525
}
2626

27-
impl<'a> ToVersion for &'a Version {
27+
impl ToVersion for &Version {
2828
fn to_version(self) -> Result<Version> {
2929
Ok(self.clone())
3030
}

scarb/src/ops/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ fn format_file_in_place(
297297
}
298298
}
299299

300-
impl<'t> ParallelVisitor for PathFormatter<'t> {
300+
impl ParallelVisitor for PathFormatter<'_> {
301301
fn visit(&mut self, dir_entry_res: Result<DirEntry, Error>) -> WalkState {
302302
let dir_entry = if let Ok(dir_entry) = dir_entry_res {
303303
dir_entry

scarb/src/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn shlex_join(cmd: &Command) -> String {
175175

176176
struct ShlexJoin<'a>(&'a Command);
177177

178-
impl<'a> fmt::Display for ShlexJoin<'a> {
178+
impl fmt::Display for ShlexJoin<'_> {
179179
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
180180
fn write_quoted(f: &mut fmt::Formatter<'_>, s: &OsStr) -> fmt::Result {
181181
let utf = s.to_string_lossy();

scarb/src/sources/git/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl<'c> GitSource<'c> {
150150
}
151151

152152
#[async_trait]
153-
impl<'c> Source for GitSource<'c> {
153+
impl Source for GitSource<'_> {
154154
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
155155
self.ensure_loaded()
156156
.await?
@@ -164,7 +164,7 @@ impl<'c> Source for GitSource<'c> {
164164
}
165165
}
166166

167-
impl<'c> fmt::Debug for GitSource<'c> {
167+
impl fmt::Debug for GitSource<'_> {
168168
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
169169
f.debug_struct("GitSource")
170170
.field("source", &self.source_id.to_string())

scarb/src/sources/path.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'c> PathSource<'c> {
9191
}
9292

9393
#[async_trait]
94-
impl<'c> Source for PathSource<'c> {
94+
impl Source for PathSource<'_> {
9595
#[tracing::instrument(level = "trace", skip(self))]
9696
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
9797
Ok(self
@@ -114,7 +114,7 @@ impl<'c> Source for PathSource<'c> {
114114
}
115115
}
116116

117-
impl<'c> fmt::Debug for PathSource<'c> {
117+
impl fmt::Debug for PathSource<'_> {
118118
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
119119
f.debug_struct("PathSource")
120120
.field("source", &self.source_id.to_string())

scarb/src/sources/registry.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'c> RegistrySource<'c> {
6868
}
6969

7070
#[async_trait]
71-
impl<'c> Source for RegistrySource<'c> {
71+
impl Source for RegistrySource<'_> {
7272
#[tracing::instrument(level = "trace", skip(self))]
7373
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
7474
let records = self
@@ -159,7 +159,7 @@ impl<'c> RegistrySource<'c> {
159159
}
160160
}
161161

162-
impl<'c> fmt::Debug for RegistrySource<'c> {
162+
impl fmt::Debug for RegistrySource<'_> {
163163
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
164164
f.debug_struct("RegistrySource")
165165
.field("source", &self.source_id.to_string())

scarb/src/sources/standard_lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl<'c> StandardLibSource<'c> {
7676
}
7777

7878
#[async_trait]
79-
impl<'c> Source for StandardLibSource<'c> {
79+
impl Source for StandardLibSource<'_> {
8080
#[tracing::instrument(level = "trace", skip(self))]
8181
async fn query(&self, dependency: &ManifestDependency) -> Result<Vec<Summary>> {
8282
self.ensure_loaded().await?.query(dependency).await
@@ -88,7 +88,7 @@ impl<'c> Source for StandardLibSource<'c> {
8888
}
8989
}
9090

91-
impl<'c> fmt::Debug for StandardLibSource<'c> {
91+
impl fmt::Debug for StandardLibSource<'_> {
9292
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9393
f.debug_struct("StandardLibSource").finish_non_exhaustive()
9494
}

utils/scarb-test-support/src/project_builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub struct DepWith<'a, T: DepBuilder + ?Sized> {
251251
value: Value,
252252
}
253253

254-
impl<'a, T: DepBuilder + ?Sized> DepBuilder for DepWith<'a, T> {
254+
impl<T: DepBuilder + ?Sized> DepBuilder for DepWith<'_, T> {
255255
fn build(&self) -> Value {
256256
let mut table = self.dep.build();
257257
table

utils/scarb-ui/src/args/packages_filter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ impl<'a> Spec<'a> {
285285
}
286286
}
287287

288-
impl<'a> fmt::Display for Spec<'a> {
288+
impl fmt::Display for Spec<'_> {
289289
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
290290
match self {
291291
Spec::All => write!(f, "*"),

utils/scarb-ui/src/components/status.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'a> Status<'a> {
3535
}
3636
}
3737

38-
impl<'a> Message for Status<'a> {
38+
impl Message for Status<'_> {
3939
fn text(self) -> String {
4040
format!(
4141
"{} {}",

utils/scarb-ui/src/components/typed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a> TypedMessage<'a> {
6464
}
6565
}
6666

67-
impl<'a> Message for TypedMessage<'a> {
67+
impl Message for TypedMessage<'_> {
6868
fn text(self) -> String {
6969
if self.skip_type_for_text {
7070
self.message.to_string()

utils/scarb-ui/src/components/value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<'a, T> ValueMessage<'a, T> {
2525
}
2626
}
2727

28-
impl<'a, T> Message for ValueMessage<'a, T>
28+
impl<T> Message for ValueMessage<'_, T>
2929
where
3030
T: Display + Serialize,
3131
{

0 commit comments

Comments
 (0)