mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
string: strip_margin: fix the error message for multiple args
This commit is contained in:
parent
8e2537a366
commit
8d19ba9195
@ -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")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user