GithubHelp home page GithubHelp logo

Comments (5)

bIgBV avatar bIgBV commented on May 14, 2024 1

@hawkw yeah I'd like to work on this. And the Clear impl for Option looks like a great way to move forward with this.

from sharded-slab.

hawkw avatar hawkw commented on May 14, 2024

In the Slabs case we need the type to be an Option<T> in order to call Option::take.

Since we're not actually returning the taken item in this code path, can't we just use the Clear impl for Option?

impl<T> Clear for Option<T> {
fn clear(&mut self) {
let _ = self.take();
}
}

This should have equivalent behavior to the current implementation. I think it should be fine to have one code path that's used by both guards. It's only Slab::take that requires special-casing.

from sharded-slab.

hawkw avatar hawkw commented on May 14, 2024

@bIgBV Are you interested in working on this? I'd like this to be addressed before we publish a release with the object pool API. If you're busy, I'm happy to take care of it so we can move closer to a release.

from sharded-slab.

hawkw avatar hawkw commented on May 14, 2024

Okay, great. I think this is the last release blocker for the pool.

from sharded-slab.

hawkw avatar hawkw commented on May 14, 2024

Looks like this probably isn't going to be possible with the current state of things (see #33 (comment) and #33 (comment)) so I'm not going to block the release on it.

from sharded-slab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.