use pinned_pool::PinnedPool;
fn main() {
let mut pool = PinnedPool::<String>::new();
let alice_key = pool.insert("Alice".to_string());
let bob_key = pool.insert("Bob".to_string());
let charlie_key = pool.insert("Charlie".to_string());
println!(
"Object pool contains {} items, with an auto-adjusting capacity of {}",
pool.len(),
pool.capacity()
);
let alice = pool.get(alice_key);
println!("Retrieved item: {alice}");
pool.remove(bob_key);
pool.remove(charlie_key);
let alice = pool.get(alice_key);
println!("Retrieved item after removal of other items: {alice}",);
let mut alice = pool.get_mut(alice_key);
alice.push_str(" Smith");
println!("Modified item: {alice}");
}