Skip to content

Commit 1b70342

Browse files
committed
Fix trim deprecation warnings
1 parent 25b681f commit 1b70342

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/header.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl EarlyProps {
122122

123123
if let Some(ref actual_version) = config.lldb_version {
124124
if line.starts_with("min-lldb-version") {
125-
let min_version = line.trim_right()
125+
let min_version = line.trim_end()
126126
.rsplit(' ')
127127
.next()
128128
.expect("Malformed lldb version directive");
@@ -143,15 +143,15 @@ impl EarlyProps {
143143
}
144144
if let Some(ref actual_version) = config.llvm_version {
145145
if line.starts_with("min-llvm-version") {
146-
let min_version = line.trim_right()
146+
let min_version = line.trim_end()
147147
.rsplit(' ')
148148
.next()
149149
.expect("Malformed llvm version directive");
150150
// Ignore if actual version is smaller the minimum required
151151
// version
152152
&actual_version[..] < min_version
153153
} else if line.starts_with("min-system-llvm-version") {
154-
let min_version = line.trim_right()
154+
let min_version = line.trim_end()
155155
.rsplit(' ')
156156
.next()
157157
.expect("Malformed llvm version directive");
@@ -405,14 +405,14 @@ fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut FnMut(&str)) {
405405
None => false,
406406
};
407407
if matches {
408-
it(ln[(close_brace + 1) ..].trim_left());
408+
it(ln[(close_brace + 1) ..].trim_start());
409409
}
410410
} else {
411411
panic!("malformed condition directive: expected `//[foo]`, found `{}`",
412412
ln)
413413
}
414414
} else if ln.starts_with("//") {
415-
it(ln[2..].trim_left());
415+
it(ln[2..].trim_start());
416416
}
417417
}
418418
return;

src/runtest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,8 +1781,8 @@ actual:\n\
17811781
content.lines()
17821782
.enumerate()
17831783
.filter_map(|(line_nb, line)| {
1784-
if (line.trim_left().starts_with("pub mod ") ||
1785-
line.trim_left().starts_with("mod ")) &&
1784+
if (line.trim_start().starts_with("pub mod ") ||
1785+
line.trim_start().starts_with("mod ")) &&
17861786
line.ends_with(';') {
17871787
if let Some(ref mut other_files) = other_files {
17881788
other_files.push(line.rsplit("mod ")
@@ -1793,7 +1793,7 @@ actual:\n\
17931793
None
17941794
} else {
17951795
let sline = line.split("///").last().unwrap_or("");
1796-
let line = sline.trim_left();
1796+
let line = sline.trim_start();
17971797
if line.starts_with("```") {
17981798
if ignore {
17991799
ignore = false;
@@ -2585,7 +2585,7 @@ fn normalize_mir_line(line: &str) -> String {
25852585
fn nocomment_mir_line(line: &str) -> &str {
25862586
if let Some(idx) = line.find("//") {
25872587
let (l, _) = line.split_at(idx);
2588-
l.trim_right()
2588+
l.trim_end()
25892589
} else {
25902590
line
25912591
}

0 commit comments

Comments
 (0)