GithubHelp home page GithubHelp logo

lazycell's People

Contributors

alexcrichton avatar archer884 avatar carllerche avatar dherman avatar dirkyjerky avatar est31 avatar homu avatar indiv0 avatar matklad avatar novacrazy avatar oconnor663 avatar oherrala avatar regexident avatar sagebind avatar techcable avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lazycell's Issues

LazyCell::borrow_with might be unsound

To avoid the kind of shenanigans described by dbaupp here, an assert! must be added between the closure call and the LazyCell initialization in borrow_with.

Additionally, a test needs to be added to ensure that a dangling pointer can't be created in this situation.

borrow_mut?

Is there a safety reason why LazyCell does not implement borrow_mut()? (assuming it'd be on &mut self).

Modify Travis CI to Utilize `fast_finish`

The matrix section of .travis.yml needs to be updated with fast_finish enabled in order to quickly fail builds which fail one of the mandatory builds, without having to wait for the rest.

...
matrix:
  fast_finish: true
...

LazyCell::borrow_mut_with

Since commit fd419de added borrow_mut to LazyCell, would it also make sense to add borrow_mut_with? That seems like the most useful abstraction for using a LazyCell mutably. But maybe there's a subtle soundness issue I'm not thinking of?

Add a CHANGELOG.md Generated with `clog-cli`

Currently, the project does not have a CHANGELOG.md so it is difficult to track changes.

Adding one would greatly help in quickly getting an overview of what changes are brought with each version.

All commits should follow the conventional commit format so that clog-cli can correctly parse them.

Update `README.md`

Add information on how to utilize this library.
Convert to reference style links.

Fix Clippy Service

Currently the clippy service returns a "failed" status, this should be corrected.

Update CONTRIBUTING.md

Notices need to be added regarding updating copyright dates as well as adding yourself to the CONTRIBUTORS.md.

Update Package Includes in Cargo.toml

Currently the include directive in Cargo.toml unnecessarily includes src/*.rs and does not include CHANGELOG.md.

Cargo.toml needs to be updated to include these files.

LazyCell::borrow_with might be unsound

Cf. that mitochondria commit, in which I remove a &mut T on the stack, which may be put back on the stack by the passed f if OnceCell::init_once is called again reentrantly.

@eddyb also raises the concern that the current code might drop uninitialised memory, because the result of f() isn't first bound to a variable on stack and instead is put directly in the &mut T.

documentation inconsistencies about mutability

Since commit fd419de, the docs have become inconsistent about whether LazyCell allows mutation. There are several places that claim it's permanently frozen once it's been initialized:

This crate provides a LazyCell struct which acts as a lazily filled Cell, but with frozen contents.

LazyCell: A lazily filled Cell, with frozen contents.

But with that commit, the borrow_mut method now allows it to be mutated, so it doesn't really make sense to describe it as having frozen contents anymore, does it?

That commit also resulted in this pretty confusing sentence:

The limitation of a LazyCell is that after it is initialized and shared, it can be modified.

I can't really figure out what that's trying to say. What does sharing have to do with it, and how is it a limitation to be able to modified?

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.