Adds an unchecked version of unwrap()
and expect()
to Option
and Result
for the rust programming language.
Supports no_std
.
```rust use unchecked_unwrap::*;
let x = Some("air"); asserteq!(unsafe { x.uncheckedunwrap() }, "air");
let x: Result
let x = Some("value"); asserteq!(unsafe { x.uncheckedexpect("the world is ending") }, "value");
let x: Result
debug-assertions
is enabled.feature(external_doc)
.feature(test)
.feature(track_caller)
.Documentation is available online in the badge links above.
Currently, nightly is needed for full documentation: cargo doc --features nightly
If you are not using nightly, use cargo doc
as usual.
Is as simple as cargo test
and cargo test --release
.
Is as simple as cargo bench
.
Currently the nightly version of rust and the feature="nightly"
is needed for benchmarking.
This crate is checked daily by CI to make sure that it builds successfully with the newest versions of rust stable, beta and nightly.
This work is dual-licensed under MIT and Apache 2.0. You can choose between one of them if you use this work.
See the LICENSE file for details
SPDX-License-Identifier: MIT OR Apache-2.0