From 582aefa54a81551381d72ba6ef20d7c460e1cd8f Mon Sep 17 00:00:00 2001 From: Justine Date: Fri, 9 Aug 2024 20:59:11 +0200 Subject: [PATCH] first commit --- README.md | 5 +++++ src/main.rs | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..04c2663 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# What is this ? + +Contient un bon exemple réutilisable d'implémentation d'un fichier de conf en yaml à l'aide de Serde. + +Il y'a juste à adapter le struct AppConf aux besoins et sa fonction default(). diff --git a/src/main.rs b/src/main.rs index ac7ec45..1292d6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,15 +48,10 @@ impl AppConf { } - - - - - - fn main() { let myconf = AppConf::default(); myconf.to_file(&Path::new("./settings.yml")); + //myconf == Ok(AppConf) let myconf = AppConf::from_file(Path::new("./settings.yml"));//.unwrap() dbg!(myconf); }