feat: ✨ eliminating comments in config
This commit is contained in:
parent
608f91c381
commit
6be3a7f5c6
1 changed files with 6 additions and 2 deletions
|
@ -89,13 +89,17 @@ impl Input {
|
||||||
reader
|
reader
|
||||||
.lines()
|
.lines()
|
||||||
.map(|unchecked_line| unchecked_line.unwrap())
|
.map(|unchecked_line| unchecked_line.unwrap())
|
||||||
.filter(|unwrapped_line| !unwrapped_line.starts_with('#'))
|
.map(|mut line|{
|
||||||
|
if let Some(comment_location) = line.find('#') {
|
||||||
|
let _ = line.split_off(comment_location);
|
||||||
|
}
|
||||||
|
line
|
||||||
|
})
|
||||||
.for_each(|line| {
|
.for_each(|line| {
|
||||||
lines.append(
|
lines.append(
|
||||||
&mut line
|
&mut line
|
||||||
.split('=')
|
.split('=')
|
||||||
.map(|splitted| splitted.trim().to_string())
|
.map(|splitted| splitted.trim().to_string())
|
||||||
.filter(|trimmed| !trimmed.starts_with('#'))
|
|
||||||
.collect::<Vec<String>>(),
|
.collect::<Vec<String>>(),
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue