From: Ian Jackson Date: Wed, 18 Nov 2020 11:29:16 +0000 (+0000) Subject: rename toml to toml_de X-Git-Tag: otter-0.2.0~493 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=d4aef844469d4962404c7f656b3bb7fc3849273c;p=otter.git rename toml to toml_de Signed-off-by: Ian Jackson --- diff --git a/src/bin/otter.rs b/src/bin/otter.rs index c5ca7ca6..7934eb5d 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -539,7 +539,7 @@ fn read_spec(filename: &str, what: &str) -> T { let mut f = File::open(filename).context("open")?; let mut buf = String::new(); f.read_to_string(&mut buf).context("read")?; - let spec : T = otter::toml::from_str(&buf).context("parse")?; + let spec : T = toml_de::from_str(&buf).context("parse")?; Ok::<_,AE>(spec) })().with_context(|| format!("read {} {:?}", what, filename))? } diff --git a/src/config.rs b/src/config.rs index 68a0faf2..5c5303a5 100644 --- a/src/config.rs +++ b/src/config.rs @@ -117,7 +117,7 @@ impl ServerConfig { let mut buf = String::new(); File::open(&config_filename).with_context(||config_filename.to_string())? .read_to_string(&mut buf)?; - let config : ServerConfigSpec = crate::toml::from_str(&buf)?; + let config : ServerConfigSpec = toml_de::from_str(&buf)?; let config = config.try_into()?; set_config(config); } @@ -125,7 +125,7 @@ impl ServerConfig { impl Default for ServerConfig { fn default() -> ServerConfig { - let spec : ServerConfigSpec = crate::toml::from_str(r#" + let spec : ServerConfigSpec = toml_de::from_str(r#" public_url = "XXX" "#) .expect("parse dummy config as ServerConfigSpec"); diff --git a/src/imports.rs b/src/imports.rs index 3edb9429..c2c673f3 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -131,6 +131,7 @@ pub use crate::tz::*; pub use crate::config::*; pub use crate::accounts::*; pub use crate::accounts::loaded_acl::{self,LoadedAcl,EffectiveACL,PermSet}; +pub use crate::toml_de; pub use zcoord::{self, ZCoord}; diff --git a/src/lib.rs b/src/lib.rs index 95f54306..b8f51b70 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,5 +27,5 @@ pub mod shapelib; pub mod tz; pub mod accounts; pub mod config; -pub mod toml; +#[path="toml-de.rs"] pub mod toml_de; #[path="slotmap-slot-idx.rs"] pub mod slotmap_slot_idx; diff --git a/src/toml.rs b/src/toml-de.rs similarity index 100% rename from src/toml.rs rename to src/toml-de.rs