Skip to content

Commit cf0879e

Browse files
committed
🧹 Complete docs
1 parent 1b63792 commit cf0879e

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

src/ini.rs

+38-1
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,45 @@ pub struct Ini {
3535
///```
3636
#[derive(Debug, Clone, Eq, PartialEq, Default)]
3737
pub struct IniDefault {
38+
///Denotes the default section header name.
39+
///## Example
40+
///```rust
41+
///use configparser::ini::Ini;
42+
///
43+
///let mut config = Ini::new();
44+
///let default = config.defaults();
45+
///assert_eq!(default.default_section, "default");
46+
///```
3847
pub default_section: std::string::String,
48+
///Denotes the set comment symbols for the object.
49+
///## Example
50+
///```rust
51+
///use configparser::ini::Ini;
52+
///
53+
///let mut config = Ini::new();
54+
///let default = config.defaults();
55+
///assert_eq!(default.comment_symbols, vec![';', '#']);
56+
///```
3957
pub comment_symbols: Vec<char>,
58+
///Denotes the set delimiters for the key-value pairs.
59+
///## Example
60+
///```rust
61+
///use configparser::ini::Ini;
62+
///
63+
///let mut config = Ini::new();
64+
///let default = config.defaults();
65+
///assert_eq!(default.delimiters, vec!['=', ':']);
66+
///```
4067
pub delimiters: Vec<char>,
68+
///Denotes if the `Ini` object is case-sensitive.
69+
///## Example
70+
///```rust
71+
///use configparser::ini::Ini;
72+
///
73+
///let mut config = Ini::new();
74+
///let default = config.defaults();
75+
///assert_eq!(default.case_sensitive, false);
76+
///```
4177
pub case_sensitive: bool,
4278
}
4379

@@ -96,7 +132,6 @@ impl Ini {
96132
///// Now, load as usual with new defaults:
97133
///let map = config.load("tests/test.ini").unwrap();
98134
///assert_eq!(config.defaults(), default);
99-
///assert_eq!(config.defaults(), config.defaults());
100135
///
101136
///```
102137
pub fn new_from_defaults(defaults: IniDefault) -> Ini {
@@ -728,6 +763,7 @@ impl Ini {
728763
}
729764

730765
///Removes a section from the hashmap, returning the properties stored in the section if the section was previously in the map.
766+
///## Example
731767
///```rust
732768
///use configparser::ini::Ini;
733769
///
@@ -749,6 +785,7 @@ impl Ini {
749785
}
750786

751787
///Removes a key from a section in the hashmap, returning the value attached to the key if it was previously in the map.
788+
///## Example
752789
///```rust
753790
///use configparser::ini::Ini;
754791
///

0 commit comments

Comments
 (0)