MCPcopy Index your code
hub / github.com/endbasic/endbasic / set_leaf_name

Method set_leaf_name

std/src/storage/mod.rs:285–294  ·  view source on GitHub ↗

Sets the leaf name of this path.

(&mut self, name: &str)

Source from the content-addressed store, hash-verified

283
284 /// Sets the leaf name of this path.
285 fn set_leaf_name(&mut self, name: &str) {
286 if self.path.starts_with('/') {
287 self.path.clear();
288 self.path.push('/');
289 self.path.push_str(name);
290 } else {
291 self.path.clear();
292 self.path.push_str(name);
293 }
294 }
295
296 /// Sets the file name extension as long as this location corresponds to a file and not a
297 /// directory and does not already have one.

Callers 2

copyMethod · 0.80

Calls 3

pushMethod · 0.80
push_strMethod · 0.80
clearMethod · 0.45

Tested by 1