Loading Cargo.lock +7 −6 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ dependencies = [ "thiserror", "tokio", "tokio-util", "tor-bytes", "tor-basic-utils", "tor-chanmgr", "tor-circmgr", "tor-config", Loading Loading @@ -3084,7 +3084,6 @@ dependencies = [ "arrayref", "bytes", "digest 0.10.3", "educe", "generic-array", "getrandom 0.2.5", "hex-literal", Loading @@ -3107,6 +3106,7 @@ dependencies = [ "hex-literal", "rand 0.8.5", "thiserror", "tor-basic-utils", "tor-bytes", "tor-cert", "tor-error", Loading Loading @@ -3142,7 +3142,7 @@ dependencies = [ "postage", "rand 0.8.5", "thiserror", "tor-bytes", "tor-basic-utils", "tor-error", "tor-linkspec", "tor-llcrypto", Loading Loading @@ -3179,7 +3179,7 @@ dependencies = [ "serde", "static_assertions", "thiserror", "tor-bytes", "tor-basic-utils", "tor-chanmgr", "tor-config", "tor-error", Loading Loading @@ -3276,7 +3276,7 @@ dependencies = [ "tempfile", "thiserror", "time", "tor-bytes", "tor-basic-utils", "tor-checkable", "tor-circmgr", "tor-config", Loading Loading @@ -3327,7 +3327,7 @@ dependencies = [ "retain_mut", "serde", "thiserror", "tor-bytes", "tor-basic-utils", "tor-config", "tor-error", "tor-linkspec", Loading Loading @@ -3470,6 +3470,7 @@ dependencies = [ "thiserror", "tokio", "tokio-util", "tor-basic-utils", "tor-bytes", "tor-cell", "tor-cert", Loading crates/arti-client/Cargo.toml +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ error_detail = [ ] experimental-api = [] [dependencies] tor-bytes = { path="../tor-bytes", version = "0.1.0"} tor-basic-utils = { path="../tor-basic-utils", version = "0.1.0"} tor-circmgr = { path="../tor-circmgr", version = "0.1.0"} tor-config = { path="../tor-config", version = "0.1.0"} tor-chanmgr = { path="../tor-chanmgr", version = "0.1.0"} Loading crates/arti-client/src/status.rs +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ use std::{borrow::Cow, fmt, time::SystemTime}; use derive_more::Display; use educe::Educe; use futures::{Stream, StreamExt}; use tor_bytes::skip_fmt; use tor_basic_utils::skip_fmt; use tor_chanmgr::{ConnBlockage, ConnStatus, ConnStatusEvents}; use tor_dirmgr::{DirBootstrapEvents, DirBootstrapStatus}; use tracing::debug; Loading crates/tor-basic-utils/src/lib.rs +37 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,40 @@ #![deny(clippy::unnecessary_wraps)] #![warn(clippy::unseparated_literal_suffix)] #![deny(clippy::unwrap_used)] use std::fmt; // ---------------------------------------------------------------------- /// Function with the signature of `Debug::fmt` that just prints `".."` /// /// ``` /// use educe::Educe; /// use tor_basic_utils::skip_fmt; /// /// #[derive(Educe, Default)] /// #[educe(Debug)] /// struct Wombat { /// visible: usize, /// /// #[educe(Debug(method = "skip_fmt"))] /// invisible: [u8; 2], /// } /// /// assert_eq!( format!("{:?}", &Wombat::default()), /// "Wombat { visible: 0, invisible: .. }" ); /// ``` // // This function is here in tor-bytes because crates that want to use it will largely // be trying to avoid dumping packet data. // But, it may at some point want to move to a lower-layer crate. // If we do that, we should `pub use` it here, if we don't want a semver break. pub fn skip_fmt<T>(_: &T, f: &mut fmt::Formatter) -> fmt::Result { /// Inner function avoids code bloat due to generics fn inner(f: &mut fmt::Formatter) -> fmt::Result { write!(f, "..") } inner(f) } // ---------------------------------------------------------------------- crates/tor-bytes/Cargo.toml +0 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ thiserror = "1" [dev-dependencies] hex-literal = "0.3" educe = "0.4.6" [target.wasm32-unknown-unknown.dependencies] getrandom = { version = "0.2.3", features = ["js"] } Loading
Cargo.lock +7 −6 Original line number Diff line number Diff line Loading @@ -138,7 +138,7 @@ dependencies = [ "thiserror", "tokio", "tokio-util", "tor-bytes", "tor-basic-utils", "tor-chanmgr", "tor-circmgr", "tor-config", Loading Loading @@ -3084,7 +3084,6 @@ dependencies = [ "arrayref", "bytes", "digest 0.10.3", "educe", "generic-array", "getrandom 0.2.5", "hex-literal", Loading @@ -3107,6 +3106,7 @@ dependencies = [ "hex-literal", "rand 0.8.5", "thiserror", "tor-basic-utils", "tor-bytes", "tor-cert", "tor-error", Loading Loading @@ -3142,7 +3142,7 @@ dependencies = [ "postage", "rand 0.8.5", "thiserror", "tor-bytes", "tor-basic-utils", "tor-error", "tor-linkspec", "tor-llcrypto", Loading Loading @@ -3179,7 +3179,7 @@ dependencies = [ "serde", "static_assertions", "thiserror", "tor-bytes", "tor-basic-utils", "tor-chanmgr", "tor-config", "tor-error", Loading Loading @@ -3276,7 +3276,7 @@ dependencies = [ "tempfile", "thiserror", "time", "tor-bytes", "tor-basic-utils", "tor-checkable", "tor-circmgr", "tor-config", Loading Loading @@ -3327,7 +3327,7 @@ dependencies = [ "retain_mut", "serde", "thiserror", "tor-bytes", "tor-basic-utils", "tor-config", "tor-error", "tor-linkspec", Loading Loading @@ -3470,6 +3470,7 @@ dependencies = [ "thiserror", "tokio", "tokio-util", "tor-basic-utils", "tor-bytes", "tor-cell", "tor-cert", Loading
crates/arti-client/Cargo.toml +1 −1 Original line number Diff line number Diff line Loading @@ -28,7 +28,7 @@ error_detail = [ ] experimental-api = [] [dependencies] tor-bytes = { path="../tor-bytes", version = "0.1.0"} tor-basic-utils = { path="../tor-basic-utils", version = "0.1.0"} tor-circmgr = { path="../tor-circmgr", version = "0.1.0"} tor-config = { path="../tor-config", version = "0.1.0"} tor-chanmgr = { path="../tor-chanmgr", version = "0.1.0"} Loading
crates/arti-client/src/status.rs +1 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ use std::{borrow::Cow, fmt, time::SystemTime}; use derive_more::Display; use educe::Educe; use futures::{Stream, StreamExt}; use tor_bytes::skip_fmt; use tor_basic_utils::skip_fmt; use tor_chanmgr::{ConnBlockage, ConnStatus, ConnStatusEvents}; use tor_dirmgr::{DirBootstrapEvents, DirBootstrapStatus}; use tracing::debug; Loading
crates/tor-basic-utils/src/lib.rs +37 −0 Original line number Diff line number Diff line Loading @@ -28,3 +28,40 @@ #![deny(clippy::unnecessary_wraps)] #![warn(clippy::unseparated_literal_suffix)] #![deny(clippy::unwrap_used)] use std::fmt; // ---------------------------------------------------------------------- /// Function with the signature of `Debug::fmt` that just prints `".."` /// /// ``` /// use educe::Educe; /// use tor_basic_utils::skip_fmt; /// /// #[derive(Educe, Default)] /// #[educe(Debug)] /// struct Wombat { /// visible: usize, /// /// #[educe(Debug(method = "skip_fmt"))] /// invisible: [u8; 2], /// } /// /// assert_eq!( format!("{:?}", &Wombat::default()), /// "Wombat { visible: 0, invisible: .. }" ); /// ``` // // This function is here in tor-bytes because crates that want to use it will largely // be trying to avoid dumping packet data. // But, it may at some point want to move to a lower-layer crate. // If we do that, we should `pub use` it here, if we don't want a semver break. pub fn skip_fmt<T>(_: &T, f: &mut fmt::Formatter) -> fmt::Result { /// Inner function avoids code bloat due to generics fn inner(f: &mut fmt::Formatter) -> fmt::Result { write!(f, "..") } inner(f) } // ----------------------------------------------------------------------
crates/tor-bytes/Cargo.toml +0 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ thiserror = "1" [dev-dependencies] hex-literal = "0.3" educe = "0.4.6" [target.wasm32-unknown-unknown.dependencies] getrandom = { version = "0.2.3", features = ["js"] }