Sled: `Clone` on `Db` in 0.17: migrating from 0.16

Created on 8 Jan 2019  路  4Comments  路  Source: spacejam/sled

  1. sled version 0.17.1
  2. rustc version n/a
  3. operating system n/a

I used to use Tree::clone before 0.17 for some multi threading and background threads. Now, on Db, there's no #[derive(Clone)]. Is this intentional? It was very convenient!

If lacking Clone is intentional, I suggest adding some comment to the source of struct Db to signify why Db cannot be Clone.

Most helpful comment

about to put out 0.17.3 which will also implement Send which will probably resolve the next problem you'll hit

All 4 comments

whoops, this should definitely be Clone! in my tests I wrap things in Arc due to old versions of this not having it, but it totally should be usable without an external Arc on things. I'll cut 0.17.2 in a few minutes after tests pass!

0.17.2 is published with a fix to this. sorry for letting this fall through the cracks!

about to put out 0.17.3 which will also implement Send which will probably resolve the next problem you'll hit

Nice! Thanks again for the update. Apparently, I didn't rely on Clone anymore, but my wrapping struct still had #[derive(Clone)]. Maybe use that somewhere in a test such that you hit it upon refactor next time? :-)

Was this page helpful?
0 / 5 - 0 ratings