Bug 1890793: Assert CallArgs::newTarget is not gray. r=spidermonkey-reviewers,sfink...
[gecko.git] / third_party / rust / void / README.md
blob4f86c21cca5d7780754313aaa9c424231e447a34
1 # Void
3 > The uninhabited void type for use in statically impossible cases.
5 ## [Documentation](https://crates.fyi/crates/void/1.0.1)
7 The uninhabited type, `enum Void { }` is useful in dealing with cases you
8 know to be impossible. For instance, if you are implementing a trait which
9 allows for error checking, but your case always succeeds, you can mark the
10 error case or type as `Void`, signaling to the compiler it can never happen.
12 This crate also comes packed with a few traits offering extension methods to
13 `Result<T, Void>` and `Result<Void, T>`.
15 ## Usage
17 Use the crates.io repository; add this to your `Cargo.toml` along
18 with the rest of your dependencies:
20 ```toml
21 [dependencies]
22 void = "1"
23 ```
25 Then, use `Void` in your crate:
27 ```rust
28 extern crate void;
29 use void::Void;
30 ```
32 ## Author
34 [Jonathan Reem](https://medium.com/@jreem) is the primary author and maintainer of void.
36 ## License
38 MIT