chiark / gitweb /
base: Introduce a prelude module here
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Mar 2021 00:00:54 +0000 (00:00 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Mar 2021 00:00:54 +0000 (00:00 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
base/lib.rs
base/prelude.rs [new file with mode: 0644]
base/zcoord.rs

index e1b58a16bfbbea74718abef65ad16d628fd0f239..753b5ce33063d69a559d8dd9d72b5ee83d27ea11 100644 (file)
@@ -3,6 +3,7 @@
 // There is NO WARRANTY.
 
 pub mod imports;
+pub mod prelude;
 
 pub mod zcoord;
 pub mod misc;
diff --git a/base/prelude.rs b/base/prelude.rs
new file mode 100644 (file)
index 0000000..4e1b8e5
--- /dev/null
@@ -0,0 +1,21 @@
+// Copyright 2020-2021 Ian Jackson and contributors to Otter
+// SPDX-License-Identifier: AGPL-3.0-or-later
+// There is NO WARRANTY.
+
+pub use std::cmp::{max, Ordering};
+pub use std::convert::{TryFrom, TryInto};
+pub use std::fmt::{self, Debug, Display, Formatter};
+pub use std::hash::{Hash, Hasher};
+pub use std::iter;
+pub use std::num::{TryFromIntError, Wrapping};
+pub use std::str;
+pub use std::str::FromStr;
+
+pub use derive_more::*;
+pub use fehler::{throw, throws};
+pub use serde::{Deserialize, Serialize};
+pub use serde_with::DeserializeFromStr;
+pub use serde_with::SerializeDisplay;
+pub use thiserror::Error;
+
+pub use crate::misc::default;
index 1c5f34eefe9d6b7d03d80d0310935b7f126abab9..44e9ae5df6466fc7dc7774493312b74ea53190d4 100644 (file)
 //       in the same order as the provided offset multipliers.
 //       The function is deterministic
 
-use std::cmp::{max, Ordering};
-use std::convert::{TryFrom, TryInto};
-use std::fmt::{self, Debug, Display, Formatter};
-use std::hash::{Hash, Hasher};
-use std::iter;
-use std::num::{TryFromIntError, Wrapping};
-use std::str;
-use std::str::FromStr;
-
-use derive_more::*;
-use fehler::{throw, throws};
-use serde::{Deserialize, Serialize};
-use serde_with::DeserializeFromStr;
-use serde_with::SerializeDisplay;
-use thiserror::Error;
-
-use crate::misc::default;
+use crate::prelude::*;
 
 //---------- core definitions ----------