MCPcopy Create free account
hub / github.com/davidblewett/rure-python / into_item

Method into_item

regex/regex-syntax/src/ast/mod.rs:1060–1066  ·  view source on GitHub ↗

Return this union as a character class set item. If this union contains zero items, then an empty union is returned. If this concatenation contains exactly 1 item, then the corresponding item is returned. Otherwise, ClassSetItem::Union is returned.

(mut self)

Source from the content-addressed store, hash-verified

1058 /// corresponding item is returned. Otherwise, ClassSetItem::Union is
1059 /// returned.
1060 pub fn into_item(mut self) -> ClassSetItem {
1061 match self.items.len() {
1062 0 => ClassSetItem::Empty(self.span),
1063 1 => self.items.pop().unwrap(),
1064 _ => ClassSetItem::Union(self),
1065 }
1066 }
1067}
1068
1069/// A Unicode character class set operation.

Callers 2

pop_classMethod · 0.80
push_class_opMethod · 0.80

Calls 3

unwrapMethod · 0.80
lenMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected