pub fn replace(slot: usize, old: Tool, new: Tool) -> Self {
        // TODO: Should inventories store `Rc<Tool>` so callers can avoid cloning for the sake of `old`s?
        let mut replace = BTreeMap::new();
        replace.insert(slot, (old, new));
        InventoryTransaction {
            replace,
            insert: vec![],
        }
    }
/// Transaction to replace an existing item in an inventory, which will fail if the existing
/// item is not as expected.
Transaction to replace an existing item in an inventory, which will fail if the existing
item is not as expected.
Transaction to replace an existing item in an inventory which will fail if the existing item is not as expected .
pub fn replace(slot: usize, old: Tool, new: Tool) -> Self {
        // TODO: Should inventories store `Rc<Tool>` so callers can avoid cloning for the sake of `old`s?
        let mut replace = BTreeMap::new();
        replace.insert(slot, (old, new));
        InventoryTransaction {
            replace,
            insert: vec![],
        }
    }
pub fn replace ( slot : usize , old : Tool , new : Tool ) -> Self { // TODO: Should inventories store `Rc<Tool>` so callers can avoid cloning for the sake of `old`s? let mut replace = BTreeMap :: new ( ) ; replace . insert ( slot , ( old , new ) ) ; InventoryTransaction { replace , insert : vec ! [ ] , } }
Transaction to replace an existing item in an inventory, which will fail if the existing
item is not as expected.
Transaction to replace an existing item in an inventory which will fail if the existing item is not as expected .
slot
usize
old
Tool
new
Tool