Skip to content

Commit

Permalink
refactor(config): Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Page committed Mar 1, 2021
1 parent 60dbf0a commit b582700
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::collections::HashMap;
use std::io::Read;

pub trait ConfigSource {
fn walk(&self) -> Option<&dyn WalkSource> {
Expand Down Expand Up @@ -107,9 +106,7 @@ pub struct Config {

impl Config {
pub fn from_file(path: &std::path::Path) -> Result<Self, anyhow::Error> {
let mut file = std::fs::File::open(path)?;
let mut s = String::new();
file.read_to_string(&mut s)?;
let s = std::fs::read_to_string(path)?;
Self::from_toml(&s)
}

Expand Down

0 comments on commit b582700

Please sign in to comment.