Skip to content

Commit 651605f

Browse files
authored
Merge pull request #1482 from LegNeato/fix_deprecations
Remove deprecated calls to trim_(right|left)_matches
2 parents fcd2837 + ad1ce8a commit 651605f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ir/comment.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {
4848
let mut is_first = true;
4949
let lines: Vec<_> = comment
5050
.lines()
51-
.map(|l| l.trim().trim_left_matches('/'))
51+
.map(|l| l.trim().trim_start_matches('/'))
5252
.map(|l| {
5353
let indent = if is_first { "" } else { &*indent };
5454
is_first = false;
@@ -60,15 +60,15 @@ fn preprocess_single_lines(comment: &str, indent: usize) -> String {
6060

6161
fn preprocess_multi_line(comment: &str, indent: usize) -> String {
6262
let comment = comment
63-
.trim_left_matches('/')
64-
.trim_right_matches('/')
65-
.trim_right_matches('*');
63+
.trim_start_matches('/')
64+
.trim_end_matches('/')
65+
.trim_end_matches('*');
6666

6767
let indent = make_indent(indent);
6868
// Strip any potential `*` characters preceding each line.
6969
let mut is_first = true;
7070
let mut lines: Vec<_> = comment.lines()
71-
.map(|line| line.trim().trim_left_matches('*').trim_left_matches('!'))
71+
.map(|line| line.trim().trim_start_matches('*').trim_start_matches('!'))
7272
.skip_while(|line| line.trim().is_empty()) // Skip the first empty lines.
7373
.map(|line| {
7474
let indent = if is_first { "" } else { &*indent };

0 commit comments

Comments
 (0)