#debug-mode #debugging #options #unwrap #exists #compiling #compile

debug_unwrap

Adds the method debug_unwrap for when you just want to make it compile

4 stable releases

1.0.3 Apr 9, 2023
1.0.2 Apr 5, 2023
0.0.1 Apr 5, 2023

#1485 in Rust patterns

MIT license

6KB
51 lines

debug_unwrap

Description

This library adds the DebugUnwrap extension trait that adds the method debug_unwrap to the Option and Result types. It does exactly the same thing as the normal unwrap methods, but won't exist when compiling without debug_assertions enabled (i.e. when not compiling in Debug mode).

Library Features

There is also three other aliases that all have there respective library features of the same name to enable them:

  • out (enabled by default)
  • o
  • peel

You can also use the deprecate feature which makes the functions deprecated on release mode instead of flat out not existing, so that your code will compile but with warnings.


lib.rs:

Adds the method debug_unwrap for when you just want to make it compile. Not to be confused with the https://crates.io/crates/debug_unwraps crate.

This library adds the DebugUnwrap extension trait that adds the method debug_unwrap to the Option and Result types. It does exactly the same thing as the normal unwrap methods, but won't exist when compiling without debug_assertions enabled (i.e. when not compiling in Debug mode).

There is also three other aliases that all have there respective library features of the same name to enable them:

  • out (enabled by default)
  • o
  • peel

You can also use the deprecate feature which makes the functions deprecated on release mode instead of flat out not existing, so that your code will compile but with warnings.

No runtime deps

Features