mod.rs 365 B

123456789101112131415
  1. use std::fs;
  2. #[derive(serde::Deserialize)]
  3. pub struct FlowyConfig {
  4. pub proto_crates: Vec<String>,
  5. pub event_files: Vec<String>,
  6. }
  7. impl FlowyConfig {
  8. pub fn from_toml_file(path: &str) -> Self {
  9. let content = fs::read_to_string(path).unwrap();
  10. let config: FlowyConfig = toml::from_str(content.as_ref()).unwrap();
  11. config
  12. }
  13. }