pub(crate) struct CfgSelectArm {
pub(crate) predicate: CfgSelectFormatPredicate,
pub(crate) arrow: Token,
pub(crate) expr: Box<Expr>,
pub(crate) trailing_comma: Option<Span>,
}Expand description
Each $predicate => $production arm in cfg_select!.
Fields§
§predicate: CfgSelectFormatPredicateThe $predicate part.
arrow: TokenSpan of =>.
expr: Box<Expr>The RHS $production expression.
trailing_comma: Option<Span>cfg_select! arms $productions can be optionally , terminated, like match arms.
The , is not needed when $production is itself braced {}.
Implementations§
Source§impl CfgSelectArm
impl CfgSelectArm
Sourcepub(crate) fn maybe_double_block_concise_formatting(
&self,
context: &RewriteContext<'_>,
) -> Option<&Expr>
pub(crate) fn maybe_double_block_concise_formatting( &self, context: &RewriteContext<'_>, ) -> Option<&Expr>
Is the cfg_select! arm written with two consecutive blocks in a way that we can apply a
concise formatting happy path? For example:
$predicate => {{}}If so, extract the inner block. rustfmt will preserve the double block syntax.
Trait Implementations§
Source§impl Debug for CfgSelectArm
impl Debug for CfgSelectArm
Source§impl PartialEq for &CfgSelectArm
impl PartialEq for &CfgSelectArm
Auto Trait Implementations§
impl DynSend for CfgSelectArm
impl DynSync for CfgSelectArm
impl Forget for CfgSelectArm
impl Freeze for CfgSelectArm
impl Move for CfgSelectArm
impl RefUnwindSafe for CfgSelectArm
impl Send for CfgSelectArm
impl Sync for CfgSelectArm
impl Unpin for CfgSelectArm
impl UnsafeUnpin for CfgSelectArm
impl UnwindSafe for CfgSelectArm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 128 bytes