Skip to content

xa888s/choose-from

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Choose-from

Documentation

Simple Rust library for enforcing values are chosen from a set of values, using const generics, lifetimes, and more. Please see the docs for more information.

Example usage:

use choose_from::select_from_fixed;
let choices = ["Hi", "how", "are ya?"];

let chosen = select_from_fixed(choices).with(|[first, second, third]| {
    // the provided choices allow inspection of the values
    assert_eq!(*first, "Hi");
    
    // this is our selection
    [first, third]
});

assert_eq!(chosen, ["Hi", "are ya?"]);

About

Simple Rust library for enforcing choosing between set values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages