@@ -35,9 +35,45 @@ pub struct Ini {
35
35
///```
36
36
#[ derive( Debug , Clone , Eq , PartialEq , Default ) ]
37
37
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
+ ///```
38
47
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
+ ///```
39
57
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
+ ///```
40
67
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
+ ///```
41
77
pub case_sensitive : bool ,
42
78
}
43
79
@@ -96,7 +132,6 @@ impl Ini {
96
132
///// Now, load as usual with new defaults:
97
133
///let map = config.load("tests/test.ini").unwrap();
98
134
///assert_eq!(config.defaults(), default);
99
- ///assert_eq!(config.defaults(), config.defaults());
100
135
///
101
136
///```
102
137
pub fn new_from_defaults ( defaults : IniDefault ) -> Ini {
@@ -728,6 +763,7 @@ impl Ini {
728
763
}
729
764
730
765
///Removes a section from the hashmap, returning the properties stored in the section if the section was previously in the map.
766
+ ///## Example
731
767
///```rust
732
768
///use configparser::ini::Ini;
733
769
///
@@ -749,6 +785,7 @@ impl Ini {
749
785
}
750
786
751
787
///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
752
789
///```rust
753
790
///use configparser::ini::Ini;
754
791
///
0 commit comments