clap_builder/builder/
arg_predicate.rs1use crate::builder::OsStr;
2
3#[derive(#[automatically_derived]
impl ::core::clone::Clone for ArgPredicate {
#[inline]
fn clone(&self) -> Self {
match self {
Self::IsPresent => Self::IsPresent,
Self::Equals(__self_0) =>
Self::Equals(::core::clone::Clone::clone(__self_0)),
}
}
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for ArgPredicate {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::IsPresent =>
::core::fmt::Formatter::write_str(f, "IsPresent"),
Self::Equals(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Equals",
&__self_0),
}
}
}Debug, #[automatically_derived]
impl ::core::marker::StructuralPartialEq for ArgPredicate { }
#[automatically_derived]
impl ::core::cmp::PartialEq for ArgPredicate {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::Equals(__self_0), Self::Equals(__arg1_0)) =>
__self_0 == __arg1_0,
_ => true,
}
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for ArgPredicate {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<OsStr>;
}
}Eq)]
7#[cfg_attr(feature = "unstable-v5", non_exhaustive)]
8pub enum ArgPredicate {
9 IsPresent,
11 Equals(OsStr),
13}
14
15impl<S: Into<OsStr>> From<S> for ArgPredicate {
16 fn from(other: S) -> Self {
17 Self::Equals(other.into())
18 }
19}