refac(cmd/push): change split to lines

This commit is contained in:
Dmitriy Pleshevskiy 2021-12-24 17:15:21 +03:00
parent 25ea845448
commit 7bf0ab43a2

View file

@ -38,7 +38,7 @@ impl StreamCommand for PushCommand<'_> {
} }
fn remove_multiline(text: &str) -> String { fn remove_multiline(text: &str) -> String {
text.split('\n') text.lines()
.enumerate() .enumerate()
.fold(String::new(), |mut acc, (i, line)| { .fold(String::new(), |mut acc, (i, line)| {
if i != 0 && !line.is_empty() && !acc.is_empty() && !acc.ends_with(' ') { if i != 0 && !line.is_empty() && !acc.is_empty() && !acc.ends_with(' ') {