Skip to content

Commit

Permalink
Merge pull request rust-lang#1482 from LegNeato/fix_deprecations
Browse files Browse the repository at this point in the history
Remove deprecated calls to trim_(right|left)_matches
  • Loading branch information
emilio authored Jan 2, 2019
2 parents fcd2837 + ad1ce8a commit 651605f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ir/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {
let mut is_first = true;
let lines: Vec<_> = comment
.lines()
.map(|l| l.trim().trim_left_matches('/'))
.map(|l| l.trim().trim_start_matches('/'))
.map(|l| {
let indent = if is_first { "" } else { &*indent };
is_first = false;
Expand All @@ -60,15 +60,15 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {

fn preprocess_multi_line(comment: &str, indent: usize) -> String {
let comment = comment
.trim_left_matches('/')
.trim_right_matches('/')
.trim_right_matches('*');
.trim_start_matches('/')
.trim_end_matches('/')
.trim_end_matches('*');

let indent = make_indent(indent);
// Strip any potential `*` characters preceding each line.
let mut is_first = true;
let mut lines: Vec<_> = comment.lines()
.map(|line| line.trim().trim_left_matches('*').trim_left_matches('!'))
.map(|line| line.trim().trim_start_matches('*').trim_start_matches('!'))
.skip_while(|line| line.trim().is_empty()) // Skip the first empty lines.
.map(|line| {
let indent = if is_first { "" } else { &*indent };
Expand Down

0 comments on commit 651605f

Please sign in to comment.