summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNora Widdecke <nora@sequoia-pgp.org>2022-08-02 13:13:41 +0200
committerNora Widdecke <nora@sequoia-pgp.org>2022-08-15 14:24:34 +0200
commit3a3f59cc84acb2dd10c623c046201046ed6ea163 (patch)
tree3a67ba7c36aae178100ec0f5fd686fe268e4115e
parentd603790fe37edefc944adc6bbf96fe7c8f11b809 (diff)
ipc: Harmonize indent macro.
- We have copies of this macro in buffered_reader and openpgp with the same semantics. - Use the code from buffered_reader and openpgp, to reduce confusion.
-rw-r--r--ipc/src/macros.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/ipc/src/macros.rs b/ipc/src/macros.rs
index 3f99f2e6..d31ab3b0 100644
--- a/ipc/src/macros.rs
+++ b/ipc/src/macros.rs
@@ -1,5 +1,3 @@
-use std::cmp;
-
macro_rules! trace {
( $TRACE:expr, $fmt:expr, $($pargs:expr),* ) => {
if $TRACE {
@@ -15,7 +13,7 @@ macro_rules! trace {
pub(crate) fn indent(i: isize) -> &'static str {
use std::convert::TryFrom;
let s = " ";
- &s[0..cmp::min(usize::try_from(i).unwrap_or(0), s.len())]
+ &s[0..usize::try_from(i).unwrap_or(0).min(s.len())]
}
macro_rules! tracer {