From: Ian Jackson Date: Sun, 14 Feb 2021 23:25:43 +0000 (+0000) Subject: Centralise flexi_logger fs2 glob htmlescape X-Git-Tag: otter-0.4.0~469 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9a48349716da3e7a499d80ec53e35094a5e6b15c;p=otter.git Centralise flexi_logger fs2 glob htmlescape Signed-off-by: Ian Jackson --- diff --git a/Cargo.lock.example b/Cargo.lock.example index d1df1e76..67a405d6 100644 --- a/Cargo.lock.example +++ b/Cargo.lock.example @@ -1650,10 +1650,6 @@ name = "otter-daemon" version = "0.0.1" dependencies = [ "fehler", - "flexi_logger", - "fs2", - "glob 0.3.0", - "htmlescape", "index_vec", "inventory", "itertools", diff --git a/Cargo.toml b/Cargo.toml index 81eb81af..6f8e2b6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,11 +29,11 @@ either = "1" enum-map = { version = "0.6", features = [ "serde" ] } env_logger = "0.8" failure = "0.1.8" # for pwd - flexi_logger = { version = "0.17", features = [ "specfile" ] } fs2 = "0.4" glob = "0.3" htmlescape = "0.3" + index_vec = { version = "0.1.1", features = ['serde'] } inventory = "0.1" itertools = "0.10" diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 6697ed46..cddb51fc 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -18,10 +18,6 @@ path = "main.rs" otter = { path = ".." } otter-base = { path = "../base" } -flexi_logger = { version = "0.17", features = [ "specfile" ] } -fs2 = "0.4" -glob = "0.3" -htmlescape = "0.3" index_vec = { version = "0.1.1", features = ['serde'] } inventory = "0.1" itertools = "0.10" diff --git a/daemon/api.rs b/daemon/api.rs index dd2f04fa..98a3c6e1 100644 --- a/daemon/api.rs +++ b/daemon/api.rs @@ -2,6 +2,8 @@ // SPDX-License-Identifier: AGPL-3.0-or-later // There is NO WARRANTY. +use crate::imports::*; + pub use super::*; type PL = PresentationLayout; diff --git a/daemon/imports.rs b/daemon/imports.rs new file mode 100644 index 00000000..35e5c4f1 --- /dev/null +++ b/daemon/imports.rs @@ -0,0 +1,5 @@ +// Copyright 2020-2021 Ian Jackson and contributors to Otter +// SPDX-License-Identifier: AGPL-3.0-or-later +// There is NO WARRANTY. + +pub use otter::imports::*; diff --git a/daemon/main.rs b/daemon/main.rs index dfe1f6c5..51552460 100644 --- a/daemon/main.rs +++ b/daemon/main.rs @@ -4,6 +4,8 @@ #![feature(proc_macro_hygiene, decl_macro)] +pub mod imports; + pub mod api; pub mod cmdlistener; pub mod session; diff --git a/src/imports.rs b/src/imports.rs index cbd895a5..ea9cd1ad 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -12,3 +12,7 @@ pub use delegate; pub use either; pub use env_logger; pub use failure; +pub use flexi_logger; +pub use fs2; +pub use glob; +pub use htmlescape; diff --git a/src/prelude.rs b/src/prelude.rs index fa9c4f3c..dc9d269f 100644 --- a/src/prelude.rs +++ b/src/prelude.rs @@ -4,6 +4,8 @@ use crate::imports::*; +pub use crate::imports::flexi_logger; + pub use std::any::Any; pub use std::borrow::Borrow; pub use std::borrow::Cow; @@ -54,7 +56,7 @@ pub use downcast_rs::{impl_downcast, Downcast}; pub use either::{Either, Left, Right}; pub use enum_map::{Enum, EnumMap}; pub use fehler::{throw, throws}; -pub use flexi_logger::{self, LogSpecification}; +pub use flexi_logger::LogSpecification; pub use fs2::FileExt; pub use if_chain::if_chain; pub use index_vec::{define_index_type, index_vec, IndexSlice, IndexVec};