Skip to content

Commit cb5388f

Browse files
committed
Fix Clippy warnings from the useless_borrows_in_formatting lint
This new lint "detects format!-style macros where an argument is passed with an explicit & but the value is already a reference, resulting in a double reference" [0]. [0]: https://rust-lang.github.io/rust-clippy/beta/index.html#useless_borrows_in_formatting Signed-off-by: Michael Weiss <michael.weiss@bull.com>
1 parent 6c40375 commit cb5388f

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/commands/source/download.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async fn perform_download(
142142

143143
let response = match client.execute(request).await {
144144
Ok(resp) => resp,
145-
Err(e) => return Err(e).with_context(|| anyhow!("Downloading '{}'", &source.url())),
145+
Err(e) => return Err(e).with_context(|| anyhow!("Downloading '{}'", source.url())),
146146
};
147147

148148
if response.status() != reqwest::StatusCode::OK {
@@ -151,7 +151,7 @@ async fn perform_download(
151151
response.status(),
152152
reqwest::StatusCode::OK
153153
))
154-
.with_context(|| anyhow!("Downloading \"{}\" failed", &source.url()));
154+
.with_context(|| anyhow!("Downloading \"{}\" failed", source.url()));
155155
}
156156

157157
progress

src/repository/fs/representation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl FileSystemRepresentation {
162162
anyhow!(
163163
"The path `{}` doesn't include the repo root `{}`",
164164
path.display(),
165-
&self.root.display()
165+
self.root.display()
166166
)
167167
})?;
168168
let mut curr_hm = &self.elements;
@@ -203,7 +203,7 @@ impl FileSystemRepresentation {
203203
anyhow!(
204204
"The path `{}` doesn't include the repo root `{}`",
205205
path.display(),
206-
&self.root.display()
206+
self.root.display()
207207
)
208208
})?;
209209
let mut curr_hm = &self.elements;

0 commit comments

Comments
 (0)