Skip to content

Commit

Permalink
🧹 Complete docs
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Jun 7, 2021
1 parent 1b63792 commit cf0879e
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion src/ini.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,45 @@ pub struct Ini {
///```
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct IniDefault {
///Denotes the default section header name.
///## Example
///```rust
///use configparser::ini::Ini;
///
///let mut config = Ini::new();
///let default = config.defaults();
///assert_eq!(default.default_section, "default");
///```
pub default_section: std::string::String,
///Denotes the set comment symbols for the object.
///## Example
///```rust
///use configparser::ini::Ini;
///
///let mut config = Ini::new();
///let default = config.defaults();
///assert_eq!(default.comment_symbols, vec![';', '#']);
///```
pub comment_symbols: Vec<char>,
///Denotes the set delimiters for the key-value pairs.
///## Example
///```rust
///use configparser::ini::Ini;
///
///let mut config = Ini::new();
///let default = config.defaults();
///assert_eq!(default.delimiters, vec!['=', ':']);
///```
pub delimiters: Vec<char>,
///Denotes if the `Ini` object is case-sensitive.
///## Example
///```rust
///use configparser::ini::Ini;
///
///let mut config = Ini::new();
///let default = config.defaults();
///assert_eq!(default.case_sensitive, false);
///```
pub case_sensitive: bool,
}

Expand Down Expand Up @@ -96,7 +132,6 @@ impl Ini {
///// Now, load as usual with new defaults:
///let map = config.load("tests/test.ini").unwrap();
///assert_eq!(config.defaults(), default);
///assert_eq!(config.defaults(), config.defaults());
///
///```
pub fn new_from_defaults(defaults: IniDefault) -> Ini {
Expand Down Expand Up @@ -728,6 +763,7 @@ impl Ini {
}

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

///Removes a key from a section in the hashmap, returning the value attached to the key if it was previously in the map.
///## Example
///```rust
///use configparser::ini::Ini;
///
Expand Down

0 comments on commit cf0879e

Please sign in to comment.