Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kixunil/dangerous_option
Implicitly unwrapped Option for Rust
https://github.com/kixunil/dangerous_option
Last synced: 3 months ago
JSON representation
Implicitly unwrapped Option for Rust
- Host: GitHub
- URL: https://github.com/kixunil/dangerous_option
- Owner: Kixunil
- License: other
- Created: 2017-05-08T13:15:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-11T22:30:11.000Z (over 7 years ago)
- Last Synced: 2024-10-12T21:06:17.455Z (3 months ago)
- Language: Rust
- Homepage:
- Size: 4.88 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Dangerous Option
================About
-----This crate provides DangerousOption - a type similar to `!` in Swift language. It's basically
an `Option` which panics if dereferenced while containing `None`. This is useful in cases one
needs to initialize things a little bit later or when accesses are made via functions called
from trusted library.While such thing might look like a step back (there's a reason we don't have NULL pointers in
Rust), there is still one advantage over classic approach of NULL-pointer exceptions (including
manually unwrapping): the cause of the bug is usually not in the place where dereferencing
happened but in the place where assignment happened. Since this type has only three, very
unique methods for creating invalid value, those can be easily searched for and tracked.This crate is `no_std`.
License
-------MITNFA