Skip to content

Commit 5665b99

Browse files
committed
fix new clippy warnings
1 parent 3968c84 commit 5665b99

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/docbuilder/rustwide_builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ mod tests {
809809
fn test_build_crate() {
810810
wrapper(|env| {
811811
let crate_ = DUMMY_CRATE_NAME;
812-
let crate_path = crate_.replace("-", "_");
812+
let crate_path = crate_.replace('-', "_");
813813
let version = DUMMY_CRATE_VERSION;
814814
let default_target = "x86_64-unknown-linux-gnu";
815815

@@ -1020,7 +1020,7 @@ mod tests {
10201020
assert!(storage.exists(&source_archive)?, "{}", source_archive);
10211021

10221022
let target = "x86_64-unknown-linux-gnu";
1023-
let crate_path = crate_.replace("-", "_");
1023+
let crate_path = crate_.replace('-', "_");
10241024
let target_docs_present = storage.exists_in_archive(
10251025
&doc_archive,
10261026
&format!("{}/{}/index.html", target, crate_path),

src/storage/s3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ impl<'a> StorageTransaction for S3StorageTransaction<'a> {
271271

272272
let to_delete = list
273273
.contents
274-
.unwrap_or_else(Vec::new)
274+
.unwrap_or_default()
275275
.into_iter()
276276
.filter_map(|o| o.key)
277277
.map(|key| ObjectIdentifier {

src/web/routes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ impl Routes {
270270
pattern.to_string(),
271271
Box::new(RequestRecorder::new(
272272
SimpleRedirect::new(|url| {
273+
#[allow(clippy::unnecessary_to_owned)]
273274
url.set_path(&url.path().trim_end_matches('/').to_string())
274275
}),
275276
pattern,

src/web/rustdoc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ mod test {
11231123
.name(name)
11241124
.version(version)
11251125
.archive_storage(archive_storage)
1126-
.rustdoc_file(&(name.replace("-", "_") + "/index.html"))
1126+
.rustdoc_file(&(name.replace('-', "_") + "/index.html"))
11271127
.create()?;
11281128
}
11291129

0 commit comments

Comments
 (0)