Skip to content

spacejam/assert_panic_free

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

assert_panic_free

A lightweight higher-order-function that doesn't compile if a function you pass to it might panic. This probably wont' work unless you're compiling your code with optimizations enabled.

Example

works when built with optimizations / release:

assert_panic_free::assert_panic_free(|| 32);

doesn't work:

assert_panic_free(|| panic!(":("));

Inspired by no_panic and panic_never but I wanted something that allowed for fine-grained panic reduction (like no_panic) but also something that compiled fast (like panic_never).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages