fix: remove useless threading

This commit is contained in:
Strix 2023-10-14 22:39:44 +02:00
parent 6cd0af304f
commit 6981fe8f16
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774
9 changed files with 157 additions and 38 deletions

27
pkgr/src/config/mod.rs Normal file
View file

@ -0,0 +1,27 @@
use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct Config {
#[serde(default)]
pub build_by_default: bool,
}
impl Config {
pub fn from_path(path: &str) -> Result<Config, String> {
match std::fs::read_to_string(path) {
Ok(s) => match toml::from_str(&s) {
Ok(c) => Ok(c),
Err(e) => Err(format!("failed to parse config: {}", e)),
},
Err(e) => Err(format!("failed to read config: {}", e)),
}
}
}
impl Default for Config {
fn default() -> Config {
Config {
build_by_default: false,
}
}
}