feat: handle comments on end of line
This commit is contained in:
parent
2fed2c8223
commit
e1279517a9
1 changed files with 2 additions and 2 deletions
|
@ -48,8 +48,8 @@ impl Config {
|
||||||
.filter(|l| !l.is_empty())
|
.filter(|l| !l.is_empty())
|
||||||
.filter(|l| !l.starts_with('#'))
|
.filter(|l| !l.starts_with('#'))
|
||||||
{
|
{
|
||||||
if line.starts_with('[') && line.ends_with(']') {
|
if line.starts_with('[') && line.contains(']') {
|
||||||
current_section = line[1..line.len() - 1].to_string();
|
current_section = line[1..line.find(']').unwrap()].to_string();
|
||||||
} else if let Some((key, value)) = line.split_once('=') {
|
} else if let Some((key, value)) = line.split_once('=') {
|
||||||
let key_trimmed_string = key.trim().replace('"', "");
|
let key_trimmed_string = key.trim().replace('"', "");
|
||||||
let key_trimmed = key_trimmed_string.as_str();
|
let key_trimmed = key_trimmed_string.as_str();
|
||||||
|
|
Loading…
Reference in a new issue