pub fn new_section(
        &mut self,
        section_name: impl Into<Cow<'event, str>>,
        subsection_name: impl Into<Option<Cow<'event, str>>>,
    ) -> MutableSection<'_, 'event> {
        let mut section = self.push_section(section_name, subsection_name, SectionBody::new());
        section.push_newline();
        section
    }
/// Adds a new section to config. If a subsection name was provided, then
/// the generated header will use the modern subsection syntax. Returns a
/// reference to the new section for immediate editing.
///
/// # Examples
///
/// Creating a new empty section:
///
/// ```
/// # use git_config::file::{GitConfig, GitConfigError};
/// # use std::convert::TryFrom;
/// let mut git_config = GitConfig::new();
/// let _section = git_config.new_section("hello", Some("world".into()));
/// assert_eq!(git_config.to_string(), "[hello \"world\"]\n");
/// ```
///
/// Creating a new empty section and adding values to it:
///
/// ```
/// # use git_config::file::{GitConfig, GitConfigError};
/// # use std::convert::TryFrom;
/// let mut git_config = GitConfig::new();
/// let mut section = git_config.new_section("hello", Some("world".into()));
/// section.push("a".into(), "b".as_bytes().into());
/// assert_eq!(git_config.to_string(), "[hello \"world\"]\n  a=b\n");
/// let _section = git_config.new_section("core", None);
/// assert_eq!(git_config.to_string(), "[hello \"world\"]\n  a=b\n[core]\n");
/// ```
Adds a new section to config. If a subsection name was provided, then
the generated header will use the modern subsection syntax. Returns a
reference to the new section for immediate editing.
Adds a new section to config . If a subsection name was provided then the generated header will use the modern subsection syntax . Returns a reference to the new section for immediate editing .
pub fn new_section(
        &mut self,
        section_name: impl Into<Cow<'event, str>>,
        subsection_name: impl Into<Option<Cow<'event, str>>>,
    ) -> MutableSection<'_, 'event> {
        let mut section = self.push_section(section_name, subsection_name, SectionBody::new());
        section.push_newline();
        section
    }
pub fn new_section ( & mut self , section_name : impl Into < Cow < ' event , str > > , subsection_name : impl Into < Option < Cow < ' event , str > > > , ) -> MutableSection < ' _ , ' event > { let mut section = self . push_section ( section_name , subsection_name , SectionBody :: new ( ) ) ; section . push_newline ( ) ; section }
Adds a new section to config.
Adds a new section to config .
&mut self
section_name
impl Into<Cow<'event, str>>
subsection_name
impl Into<Option<Cow<'event, str>>>
examples
Creating a new empty section.


Creating a new empty section .
use git_config::file::{gitconfig, gitconfigerror};
None
use std::convert::tryfrom;
let mut git_config = GitConfig::new();
let _section = git_config.new_section("hello", Some("world".into()));
assert_eq!(git_config.to_string(), "[hello \"world\"]\n");
```

Creating a new empty section and adding values to it.


let mut git_config = GitConfig :: new () ; let _section = git_config . new_section ( " hello " Some ( " world " . into () )) ; assert_eq! ( git_config . to_string () " [ hello \ " world \ " ] \ n " ) ; ` ` ` Creating a new empty section and adding values to it .
use git_config::file::{gitconfig, gitconfigerror};
None
use std::convert::tryfrom;
let mut git_config = GitConfig::new();
let mut section = git_config.new_section("hello", Some("world".into()));
section.push("a".into(), "b".as_bytes().into());
assert_eq!(git_config.to_string(), "[hello \"world\"]\n  a=b\n");
let _section = git_config.new_section("core", None);
assert_eq!(git_config.to_string(), "[hello \"world\"]\n  a=b\n[core]\n");
```
let mut git_config = GitConfig :: new () ; let mut section = git_config . new_section ( " hello " Some ( " world " . into () )) ; section . push ( " a " . into () " b " . as_bytes () . into () ) ; assert_eq! ( git_config . to_string () " [ hello \ " world \ " ] \ n a = b \ n " ) ; let _section = git_config . new_section ( " core " None ) ; assert_eq! ( git_config . to_string () " [ hello \ " world \ " ] \ n a = b \ n [ core ] \ n " ) ; ` ` `