Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trim deprecation warnings #153

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl EarlyProps {

if let Some(ref actual_version) = config.lldb_version {
if line.starts_with("min-lldb-version") {
let min_version = line.trim_right()
let min_version = line.trim_end()
.rsplit(' ')
.next()
.expect("Malformed lldb version directive");
Expand All @@ -143,15 +143,15 @@ impl EarlyProps {
}
if let Some(ref actual_version) = config.llvm_version {
if line.starts_with("min-llvm-version") {
let min_version = line.trim_right()
let min_version = line.trim_end()
.rsplit(' ')
.next()
.expect("Malformed llvm version directive");
// Ignore if actual version is smaller the minimum required
// version
&actual_version[..] < min_version
} else if line.starts_with("min-system-llvm-version") {
let min_version = line.trim_right()
let min_version = line.trim_end()
.rsplit(' ')
.next()
.expect("Malformed llvm version directive");
Expand Down Expand Up @@ -405,14 +405,14 @@ fn iter_header(testfile: &Path, cfg: Option<&str>, it: &mut FnMut(&str)) {
None => false,
};
if matches {
it(ln[(close_brace + 1) ..].trim_left());
it(ln[(close_brace + 1) ..].trim_start());
}
} else {
panic!("malformed condition directive: expected `//[foo]`, found `{}`",
ln)
}
} else if ln.starts_with("//") {
it(ln[2..].trim_left());
it(ln[2..].trim_start());
}
}
return;
Expand Down
8 changes: 4 additions & 4 deletions src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,8 +1781,8 @@ actual:\n\
content.lines()
.enumerate()
.filter_map(|(line_nb, line)| {
if (line.trim_left().starts_with("pub mod ") ||
line.trim_left().starts_with("mod ")) &&
if (line.trim_start().starts_with("pub mod ") ||
line.trim_start().starts_with("mod ")) &&
line.ends_with(';') {
if let Some(ref mut other_files) = other_files {
other_files.push(line.rsplit("mod ")
Expand All @@ -1793,7 +1793,7 @@ actual:\n\
None
} else {
let sline = line.split("///").last().unwrap_or("");
let line = sline.trim_left();
let line = sline.trim_start();
if line.starts_with("```") {
if ignore {
ignore = false;
Expand Down Expand Up @@ -2585,7 +2585,7 @@ fn normalize_mir_line(line: &str) -> String {
fn nocomment_mir_line(line: &str) -> &str {
if let Some(idx) = line.find("//") {
let (l, _) = line.split_at(idx);
l.trim_right()
l.trim_end()
} else {
line
}
Expand Down