MCPcopy Create free account
hub / github.com/bajrangCoder/setu / remove_node

Method remove_node

src/entities/collections.rs:565–583  ·  view source on GitHub ↗
(
        &mut self,
        collection_id: Uuid,
        node_id: Uuid,
        cx: &mut Context<Self>,
    )

Source from the content-addressed store, hash-verified

563
564 pub fn rename_collection(&mut self, id: Uuid, new_name: &str, cx: &mut Context<Self>) {
565 if let Some(collection) = self.collections.iter_mut().find(|c| c.id == id) {
566 collection.name = new_name.to_string();
567 self.bump_revision();
568 self.save_to_file();
569 cx.emit(CollectionsEvent::CollectionUpdated(id));
570 cx.notify();
571 }
572 }
573
574 pub fn rename_node(
575 &mut self,
576 collection_id: Uuid,
577 node_id: Uuid,
578 new_name: &str,
579 cx: &mut Context<Self>,
580 ) -> bool {
581 let Some(collection) = self.collections.iter_mut().find(|c| c.id == collection_id) else {
582 return false;
583 };
584
585 let Some(node) = find_node_mut(&mut collection.nodes, node_id) else {
586 return false;

Callers 1

Calls 2

remove_nodeFunction · 0.85
save_to_fileMethod · 0.45

Tested by

no test coverage detected