string: strip_margin: fix the error message for multiple args

pull/4033/head
Major Taylor 2020-03-15 02:49:37 -04:00 committed by GitHub
parent 8e2537a366
commit 8d19ba9195
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -1288,15 +1288,15 @@ pub fn (s string) strip_margin(del ...byte) string {
// Only care about the first one, ignore the rest if more
for d in del {
// The delimiter is not allowed to be white-space. Will use default
if !d.is_space() {
sep = d
} else {
if d.is_space() {
eprintln("Warning: `strip_margin` cannot use white-space as a delimiter")
eprintln(" Defaulting to `|`")
} else {
sep = d
}
break
}
if del.len == 1 {
if del.len != 1 {
eprintln("Warning: `strip_margin` only uses the first argument given")
}
}