MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / take

Method take

29_pattern_matching_revisited/rust/pattern/src/main.rs:53–60  ·  view source on GitHub ↗
(&mut self, obj: String, room: &mut Room)

Source from the content-addressed store, hash-verified

51 }
52
53 fn take(&mut self, obj: String, room: &mut Room) {
54 if room.objects.contains(&obj) {
55 room.objects.remove(&obj);
56 self.backpack.insert(obj);
57 } else {
58 println!("not found {}", obj);
59 }
60 }
61
62 fn drop(&mut self, obj: String, room: &mut Room) {
63 if self.backpack.contains(&obj) {

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected