Skip to content

Commit

Permalink
Fix deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
zzau13 committed Aug 8, 2019
1 parent 5afea9d commit ae5e511
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/syntest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ fn get_line_assertion_details<'a>(testtoken_start: &str, testtoken_end: Option<&
if let Some(end_token_pos) = sst.find(token) { // and there is an end token in the line
let (ss, after_token_end) = sst.split_at(end_token_pos); // the scope selector text ends at the end token
sst = &ss;
only_whitespace_after_token_end = after_token_end.trim_right().is_empty();
only_whitespace_after_token_end = after_token_end.trim_end().is_empty();
}
}
return Some(AssertionRange {
begin_char: index + if captures.get(2).is_some() { testtoken_start.len() + captures.get(2).unwrap().start() } else { 0 },
end_char: index + if captures.get(2).is_some() { testtoken_start.len() + captures.get(2).unwrap().end() } else { 1 },
scope_selector_text: sst,
is_pure_assertion_line: before_token_start.trim_left().is_empty() && only_whitespace_after_token_end, // if only whitespace surrounds the test tokens on the line, then it is a pure assertion line
is_pure_assertion_line: before_token_start.trim_start().is_empty() && only_whitespace_after_token_end, // if only whitespace surrounds the test tokens on the line, then it is a pure assertion line
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ mod tests {

let html = tokens_to_classed_html(line, &ops[..], ClassStyle::Spaced);
println!("{}", html);
assert_eq!(html, include_str!("../testdata/test2.html").trim_right());
assert_eq!(html, include_str!("../testdata/test2.html").trim_end());

let ts = ThemeSet::load_defaults();
let highlighter = Highlighter::new(&ts.themes["InspiredGitHub"]);
Expand All @@ -341,7 +341,7 @@ mod tests {

let html2 = styled_line_to_highlighted_html(&regions[..], IncludeBackground::Yes);
println!("{}", html2);
assert_eq!(html2, include_str!("../testdata/test1.html").trim_right());
assert_eq!(html2, include_str!("../testdata/test1.html").trim_end());
}

#[test]
Expand Down

0 comments on commit ae5e511

Please sign in to comment.