cargo +nightly fmt (#3540)

* cargo +nightly fmt

* add cargo-fmt check to ci

* update ci

* fmt

* fmt

* skip macro

* ignore bridges
This commit is contained in:
Shawn Tabrizi
2021-08-02 12:47:33 +02:00
committed by GitHub
parent 30e3012270
commit ff5d56fb76
350 changed files with 20617 additions and 21266 deletions
+9 -6
View File
@@ -50,9 +50,11 @@ mod config;
mod errors;
mod spans;
pub use self::config::{JaegerConfig, JaegerConfigBuilder};
pub use self::errors::JaegerError;
pub use self::spans::{PerLeafSpan, Span, Stage};
pub use self::{
config::{JaegerConfig, JaegerConfigBuilder},
errors::JaegerError,
spans::{PerLeafSpan, Span, Stage},
};
use self::spans::TraceIdentifier;
@@ -103,8 +105,9 @@ impl Jaeger {
log::info!("🐹 Collecting jaeger spans for {:?}", &jaeger_agent);
let (traces_in, mut traces_out) =
mick_jaeger::init(mick_jaeger::Config { service_name: format!("polkadot-{}", cfg.node_name) });
let (traces_in, mut traces_out) = mick_jaeger::init(mick_jaeger::Config {
service_name: format!("polkadot-{}", cfg.node_name),
});
// Spawn a background task that pulls span information and sends them on the network.
spawner.spawn(
@@ -120,7 +123,7 @@ impl Jaeger {
},
Err(e) => {
log::warn!(target: "jaeger", "UDP socket open error: {}", e);
}
},
}
}),
);
+17 -11
View File
@@ -84,12 +84,13 @@
//! ```
use parity_scale_codec::Encode;
use polkadot_primitives::v1::{BlakeTwo256, CandidateHash, Hash, HashT, Id as ParaId, ValidatorIndex};
use polkadot_node_primitives::PoV;
use polkadot_primitives::v1::{
BlakeTwo256, CandidateHash, Hash, HashT, Id as ParaId, ValidatorIndex,
};
use sc_network::PeerId;
use std::fmt;
use std::sync::Arc;
use std::{fmt, sync::Arc};
use super::INSTANCE;
@@ -240,7 +241,10 @@ impl Span {
/// Creates a new span builder based on anything that can be lazily evaluated
/// to and identifier.
pub fn new<I: LazyIdent>(identifier: I, span_name: &'static str) -> Span {
let mut span = INSTANCE.read_recursive().span(|| <I as LazyIdent>::eval(&identifier), span_name).into();
let mut span = INSTANCE
.read_recursive()
.span(|| <I as LazyIdent>::eval(&identifier), span_name)
.into();
<I as LazyIdent>::extra_tags(&identifier, &mut span);
span
}
@@ -349,8 +353,9 @@ impl Span {
#[inline(always)]
pub fn add_follows_from(&mut self, other: &Self) {
match (self, other) {
(Self::Enabled(ref mut inner), Self::Enabled(ref other_inner)) => inner.add_follows_from(&other_inner),
_ => {}
(Self::Enabled(ref mut inner), Self::Enabled(ref other_inner)) =>
inner.add_follows_from(&other_inner),
_ => {},
}
}
@@ -372,29 +377,30 @@ impl Span {
pub fn add_string_tag<V: ToString>(&mut self, tag: &'static str, val: V) {
match self {
Self::Enabled(ref mut inner) => inner.add_string_tag(tag, val.to_string().as_str()),
Self::Disabled => {}
Self::Disabled => {},
}
}
/// Add a string tag, without consuming the span.
pub fn add_string_fmt_debug_tag<V: fmt::Debug>(&mut self, tag: &'static str, val: V) {
match self {
Self::Enabled(ref mut inner) => inner.add_string_tag(tag, format!("{:?}", val).as_str()),
Self::Disabled => {}
Self::Enabled(ref mut inner) =>
inner.add_string_tag(tag, format!("{:?}", val).as_str()),
Self::Disabled => {},
}
}
pub fn add_int_tag(&mut self, tag: &'static str, value: i64) {
match self {
Self::Enabled(ref mut inner) => inner.add_int_tag(tag, value),
Self::Disabled => {}
Self::Disabled => {},
}
}
pub fn add_uint_tag(&mut self, tag: &'static str, value: u64) {
match self {
Self::Enabled(ref mut inner) => inner.add_int_tag(tag, value as i64),
Self::Disabled => {}
Self::Disabled => {},
}
}