Struct git_attributes::Name
source · pub struct Name(_);
Expand description
Represents a validated attribute name
Implementations§
source§impl<'a> Name
impl<'a> Name
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Return the inner str
.
Examples found in repository?
src/match_group.rs (line 74)
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
fn bytes_to_patterns(bytes: &[u8]) -> Vec<PatternMapping<Self::Value>> {
crate::parse(bytes)
.filter_map(Result::ok)
.filter_map(|(pattern_kind, assignments, line_number)| {
let (pattern, value) = match pattern_kind {
crate::parse::Kind::Macro(macro_name) => (
git_glob::Pattern {
text: macro_name.as_str().into(),
mode: git_glob::pattern::Mode::all(),
first_wildcard_pos: None,
},
Value::MacroAttributes(into_owned_assignments(assignments).ok()?),
),
crate::parse::Kind::Pattern(p) => (
(!p.is_negative()).then(|| p)?,
Value::Assignments(into_owned_assignments(assignments).ok()?),
),
};
PatternMapping {
pattern,
value,
sequence_number: line_number,
}
.into()
})
.collect()
}
Trait Implementations§
source§impl<'de> Deserialize<'de> for Name
impl<'de> Deserialize<'de> for Name
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Name
impl Ord for Name
source§impl PartialEq<Name> for Name
impl PartialEq<Name> for Name
source§impl PartialOrd<Name> for Name
impl PartialOrd<Name> for Name
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more