Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing test when building with --all-features #92

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ impl<'a> From<Entry<'a, SectionKey, Properties>> for SectionEntry<'a> {
}

/// Ini struct
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct Ini {
sections: ListOrderedMultimap<SectionKey, Properties>,
}
Expand Down Expand Up @@ -654,7 +654,7 @@ impl Ini {
self.sections.keys_len()
}

/// Check if object coutains no section
/// Check if object contains no section
pub fn is_empty(&self) -> bool {
self.sections.is_empty()
}
Expand All @@ -664,11 +664,9 @@ impl Default for Ini {
/// Creates an ini instance with an empty general section. This allows [Ini::general_section]
/// and [Ini::with_general_section] to be called without panicking.
fn default() -> Self {
let mut result = Ini {
sections: Default::default(),
};
let mut result = Ini { sections: Default::default() };

result.sections.insert(None::<String>, Default::default());
result.sections.insert(None, Default::default());

result
}
Expand Down Expand Up @@ -1433,7 +1431,8 @@ mod test {
assert!(opt.is_ok());

let output = opt.unwrap();
assert_eq!(output.len(), 2);
// there is always a general section
assert_eq!(output.len(), 3);
assert!(output.section(Some("sec1")).is_some());

let sec1 = output.section(Some("sec1")).unwrap();
Expand Down Expand Up @@ -1908,10 +1907,8 @@ a3 = n3

let ini = Ini::new();

let opt = WriteOption {
line_separator: LineSeparator::CR,
..Default::default()
};
let opt = WriteOption { line_separator: LineSeparator::CR,
..Default::default() };
let mut buf = Vec::new();
ini.write_to_opt(&mut buf, opt).unwrap();

Expand Down