Skip to content

Commit 2e6b205

Browse files
committed
trim_right -> trim_end
1 parent 8579044 commit 2e6b205

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ You can use `rust-script` to write a quick filter, by specifying a closure to be
136136

137137
```sh
138138
$ cat now.ers | rust-script --loop \
139-
"let mut n=0; move |l| {n+=1; println!(\"{:>6}: {}\",n,l.trim_right())}"
139+
"let mut n=0; move |l| {n+=1; println!(\"{:>6}: {}\",n,l.trim_end())}"
140140
1: // cargo-deps: time="0.1.25"
141141
3: fn main() {
142142
4: println!("{}", time::now().rfc822z());
@@ -147,7 +147,7 @@ You can achieve a similar effect to the above by using the `--count` flag, which
147147
148148
```sh
149149
$ cat now.ers | rust-script --count --loop \
150-
"|l,n| println!(\"{:>6}: {}\", n, l.trim_right())"
150+
"|l,n| println!(\"{:>6}: {}\", n, l.trim_end())"
151151
1: // cargo-deps: time="0.1.25"
152152
2: fn main() {
153153
3: println!("{}", time::now().rfc822z());

tests/scripts/loop-to-prefix.script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ set -e -u
33

44
echo "First:"
55
echo "line1\nline2" | rust-script --loop \
6-
"let mut n=0; move |l| {n+=1; println!(\"{:>6}: {}\",n,l.trim_right())}"
6+
"let mut n=0; move |l| {n+=1; println!(\"{:>6}: {}\",n,l.trim_end())}"
77

88
echo "Second:"
99
echo "line1\nline2" | rust-script --count --loop \
10-
"|l,n| println!(\"{:>6}: {}\", n, l.trim_right())"
10+
"|l,n| println!(\"{:>6}: {}\", n, l.trim_end())"

0 commit comments

Comments
 (0)