Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return key immediately on insert duplicate value #90

Open
AbstractiveNord opened this issue Oct 14, 2023 · 0 comments
Open

Return key immediately on insert duplicate value #90

AbstractiveNord opened this issue Oct 14, 2023 · 0 comments

Comments

@AbstractiveNord
Copy link

use sharded_slab::Slab;

fn main() {
    let slab = Slab::new();

    let key = slab.insert("hello world").unwrap();
    println!("Key : {}!", key);
    let key = slab.insert("hello world").unwrap();
    println!("Key : {}!", key);  // value is present, return already present key instead of new insert result
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant