Skip to content

clear() takes ownership, so it can't be wrapped #169

@borovan

Description

@borovan

Hi there, this is our Store which uses a Wrapped stable BTreeMap

image

I wanted to wrap the clear() method but I'm unable to, so the workaround is just to go over every key and delete it. We've got tests with 10,000 inserts so this doesn't seem like a great way to go about it.

I've tried std::mem::take, but that doesn't work as there's no Default value for the map. There's not much I can do because the MemoryID is required and I can't keep a reference to it for some reason.

Any ideas on how to implement clear?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions