Skip to content

Commit

Permalink
Merge pull request #105 from cita-cloud/fix_warn
Browse files Browse the repository at this point in the history
fix clippy warn
  • Loading branch information
rink1969 authored Mar 26, 2024
2 parents 532bd7b + 0136edf commit 07b0408
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

use std::collections::BTreeMap;
use std::fs;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;
use std::str::FromStr;
Expand Down Expand Up @@ -62,9 +60,11 @@ impl Config {
}

fn use_default_config(config_file: PathBuf) -> Result<Self> {
let mut f = File::options().write(true).create(true).open(config_file)?;
let default_config = Self::default();
f.write_all(toml::to_string_pretty(&default_config).unwrap().as_bytes())?;
fs::write(
config_file,
toml::to_string_pretty(&default_config).unwrap().as_bytes(),
)?;
Ok(default_config)
}

Expand Down

0 comments on commit 07b0408

Please sign in to comment.