Skip to content

Commit 4461da7

Browse files
author
Thomas Bracht Laumann Jespersen
authored
Merge pull request Manishearth#153 from phansch/fix_compiletest_trim_deprecations
Fix `trim` deprecation warnings
2 parents 5c67257 + 1b70342 commit 4461da7

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");
@@ -418,14 +418,14 @@ fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut FnMut(&str)) {
418418
None => false,
419419
};
420420
if matches {
421-
it(ln[(close_brace + 1) ..].trim_left());
421+
it(ln[(close_brace + 1) ..].trim_start());
422422
}
423423
} else {
424424
panic!("malformed condition directive: expected `//[foo]`, found `{}`",
425425
ln)
426426
}
427427
} else if ln.starts_with("//") {
428-
it(ln[2..].trim_left());
428+
it(ln[2..].trim_start());
429429
}
430430
}
431431
return;

src/runtest.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,8 +1791,8 @@ actual:\n\
17911791
content.lines()
17921792
.enumerate()
17931793
.filter_map(|(line_nb, line)| {
1794-
if (line.trim_left().starts_with("pub mod ") ||
1795-
line.trim_left().starts_with("mod ")) &&
1794+
if (line.trim_start().starts_with("pub mod ") ||
1795+
line.trim_start().starts_with("mod ")) &&
17961796
line.ends_with(';') {
17971797
if let Some(ref mut other_files) = other_files {
17981798
other_files.push(line.rsplit("mod ")
@@ -1803,7 +1803,7 @@ actual:\n\
18031803
None
18041804
} else {
18051805
let sline = line.split("///").last().unwrap_or("");
1806-
let line = sline.trim_left();
1806+
let line = sline.trim_start();
18071807
if line.starts_with("```") {
18081808
if ignore {
18091809
ignore = false;
@@ -2664,7 +2664,7 @@ fn normalize_mir_line(line: &str) -> String {
26642664
fn nocomment_mir_line(line: &str) -> &str {
26652665
if let Some(idx) = line.find("//") {
26662666
let (l, _) = line.split_at(idx);
2667-
l.trim_right()
2667+
l.trim_end()
26682668
} else {
26692669
line
26702670
}

0 commit comments

Comments
 (0)