fix mistake in Config::load and Config::save docs (fixes #256)
This commit is contained in:
parent
b5a017a58b
commit
f640e49571
1 changed files with 2 additions and 2 deletions
|
@ -242,7 +242,7 @@ impl Config {
|
||||||
|
|
||||||
/// Loads a configuration from the desired path. This will use the file extension to detect
|
/// Loads a configuration from the desired path. This will use the file extension to detect
|
||||||
/// which format to parse the file as (json, toml, or yaml). Using each format requires having
|
/// which format to parse the file as (json, toml, or yaml). Using each format requires having
|
||||||
/// its respective crate feature enabled. Only json is available by default.
|
/// its respective crate feature enabled. Only toml is available by default.
|
||||||
pub fn load<P: AsRef<Path>>(path: P) -> Result<Config> {
|
pub fn load<P: AsRef<Path>>(path: P) -> Result<Config> {
|
||||||
let mut file = File::open(&path)?;
|
let mut file = File::open(&path)?;
|
||||||
let mut data = String::new();
|
let mut data = String::new();
|
||||||
|
@ -317,7 +317,7 @@ impl Config {
|
||||||
|
|
||||||
/// Saves a configuration to the desired path. This will use the file extension to detect
|
/// Saves a configuration to the desired path. This will use the file extension to detect
|
||||||
/// which format to parse the file as (json, toml, or yaml). Using each format requires having
|
/// which format to parse the file as (json, toml, or yaml). Using each format requires having
|
||||||
/// its respective crate feature enabled. Only json is available by default.
|
/// its respective crate feature enabled. Only toml is available by default.
|
||||||
pub fn save<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
|
pub fn save<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
|
||||||
let _ = self.path.take();
|
let _ = self.path.take();
|
||||||
let mut file = File::create(&path)?;
|
let mut file = File::create(&path)?;
|
||||||
|
|
Loading…
Reference in a new issue