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

Method _push

euralios_std/src/path.rs:205–218  ·  view source on GitHub ↗
(&mut self, path: &Path)

Source from the content-addressed store, hash-verified

203 }
204
205 fn _push(&mut self, path: &Path) {
206 // in general, a separator is needed if the rightmost byte is not a separator
207 let need_sep = self.as_mut_vec().last().map(|c| !is_sep_byte(*c)).unwrap_or(false);
208
209 // absolute `path` replaces `self`
210 if path.is_absolute() {
211 self.as_mut_vec().truncate(0);
212 // `path` is a pure relative path
213 } else if !path.has_root() && need_sep {
214 self.inner.push(MAIN_SEP_STR);
215 }
216
217 self.inner.push(path);
218 }
219
220 /// Truncates `self` to [`self.parent`].
221 ///

Callers 1

pushMethod · 0.80

Calls 6

is_sep_byteFunction · 0.85
as_mut_vecMethod · 0.80
is_absoluteMethod · 0.80
truncateMethod · 0.80
has_rootMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected