Skip to content

Commit

Permalink
Auto merge of #9475 - PaulDance:fix-test-support-warning, r=ehuss
Browse files Browse the repository at this point in the history
Fix Url::into_string deprecation warning

```rust
warning: use of deprecated associated function `url::Url::into_string`: use Into<String>
   --> src/registry.rs:183:26
    |
183 |                 dl_url().into_string(),
    |                          ^^^^^^^^^^^
    |
    = note: `#[warn(deprecated)]` on by default
```

is being emitted when running `cargo build` directly from the `crates/cargo-test-support` or the `crates/mdman` crate. This simply proposes a switch to the recommended method in order to resolve the deprecation warning.
  • Loading branch information
bors committed May 10, 2021
2 parents 5c45513 + a5b4b47 commit e5fdd48
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ tempfile = "3.0"
termcolor = "1.1"
toml = "0.5.7"
unicode-xid = "0.2.0"
url = "2.0"
url = "2.2.2"
walkdir = "2.2"
clap = "2.31.2"
unicode-width = "0.1.5"
Expand Down
2 changes: 1 addition & 1 deletion crates/cargo-test-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ remove_dir_all = "0.5"
serde_json = "1.0"
tar = { version = "0.4.18", default-features = false }
toml = "0.5.7"
url = "2.0"
url = "2.2.2"
7 changes: 1 addition & 6 deletions crates/cargo-test-support/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,7 @@ impl RegistryBuilder {
}

if self.replace_crates_io {
init_registry(
registry_path(),
dl_url().into_string(),
api_url(),
api_path(),
);
init_registry(registry_path(), dl_url().into(), api_url(), api_path());
}

if self.alternative {
Expand Down
15 changes: 13 additions & 2 deletions crates/mdman/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/mdman/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ handlebars = { version = "3.2.1", features = ["dir_source"] }
pulldown-cmark = { version = "0.7.2", default-features = false }
same-file = "1.0.6"
serde_json = "1.0.56"
url = "2.1.1"
url = "2.2.2"

[dev-dependencies]
pretty_assertions = "0.6.1"
2 changes: 1 addition & 1 deletion crates/mdman/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn join_url<'a>(base: Option<&Url>, dest: CowStr<'a>) -> CowStr<'a> {
let joined = base_url.join(&dest).unwrap_or_else(|e| {
panic!("failed to join URL `{}` to `{}`: {}", dest, base_url, e)
});
joined.into_string().into()
String::from(joined).into()
}
}
None => dest,
Expand Down

0 comments on commit e5fdd48

Please sign in to comment.