修复因筛选后未换行导致打印错位
This commit is contained in:
parent
8da6c9cfd2
commit
e3c60f7c43
@ -102,13 +102,14 @@ fn try_main() -> anyhow::Result<()> {
|
|||||||
.filter_map(|line| {
|
.filter_map(|line| {
|
||||||
let line = line.unwrap();
|
let line = line.unwrap();
|
||||||
if line.contains(&filter_str) {
|
if line.contains(&filter_str) {
|
||||||
Some(line)
|
Some(line+"\n")
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.flat_map(|str| str.into_bytes())
|
.flat_map(|str| str.into_bytes())
|
||||||
.collect();
|
.collect();
|
||||||
|
println!("{}", String::from_utf8_lossy(&filter_data));
|
||||||
Box::new(Cursor::new(filter_data)) as Box<dyn Read>
|
Box::new(Cursor::new(filter_data)) as Box<dyn Read>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user