Skip to content

Commit c97f490

Browse files
committed
Address some deprecation warnings
1 parent eda23b6 commit c97f490

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() {
3030
// (git not installed or if this is not a git repository) just return an empty string.
3131
fn commit_info() -> String {
3232
match (commit_hash(), commit_date()) {
33-
(Ok(hash), Ok(date)) => format!(" ({} {})", hash.trim_right(), date),
33+
(Ok(hash), Ok(date)) => format!(" ({} {})", hash.trim_end(), date),
3434
_ => String::new(),
3535
}
3636
}

src/download/tests/support/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ fn serve_contents(
7070
// extract range "bytes={start}-"
7171
let range = range.to_str().expect("unexpected Range header");
7272
assert!(range.starts_with("bytes="));
73-
let range = range.trim_left_matches("bytes=");
73+
let range = range.trim_start_matches("bytes=");
7474
assert!(range.ends_with("-"));
75-
let range = range.trim_right_matches("-");
75+
let range = range.trim_end_matches("-");
7676
assert_eq!(range.split("-").count(), 1);
7777
let start: u64 = range.parse().expect("unexpected Range header");
7878

src/rustup-cli/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ pub fn rustc_version(toolchain: &Toolchain) -> String {
256256
.expect("Child::stdout requested but not present");
257257
let mut line = String::new();
258258
if BufReader::new(out).read_line(&mut line).is_ok() {
259-
let lineend = line.trim_right_matches(&['\r', '\n'][..]).len();
259+
let lineend = line.trim_end_matches(&['\r', '\n'][..]).len();
260260
line.truncate(lineend);
261261
line1 = Some(line);
262262
}

src/rustup-cli/rustup_mode.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ fn show(cfg: &Cfg) -> Result<()> {
734734
}
735735
},
736736
Err(err) => {
737-
if let Some(cause) = err.cause() {
737+
if let Some(cause) = err.source() {
738738
println!("(error: {}, {})", err, cause);
739739
} else {
740740
println!("(error: {})", err);

src/rustup/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl Cfg {
8686
.and_then(utils::if_not_empty)
8787
.map_or(Cow::Borrowed(dist::DEFAULT_DIST_ROOT), Cow::Owned)
8888
.as_ref()
89-
.trim_right_matches("/dist")
89+
.trim_end_matches("/dist")
9090
.to_owned()
9191
}
9292
};

0 commit comments

Comments
 (0)