MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / trim_right

Method trim_right

euralios_std/src/path.rs:813–822  ·  view source on GitHub ↗

trim away repeated separators (i.e., empty components) on the right

(&mut self)

Source from the content-addressed store, hash-verified

811
812 // trim away repeated separators (i.e., empty components) on the right
813 fn trim_right(&mut self) {
814 while self.path.len() > self.len_before_body() {
815 let (size, comp) = self.parse_next_component_back();
816 if comp.is_some() {
817 return;
818 } else {
819 self.path = &self.path[..self.path.len() - size];
820 }
821 }
822 }
823}
824
825impl<'a> Iterator for Components<'a> {

Callers 1

as_pathMethod · 0.80

Calls 3

len_before_bodyMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected