From 299992390aa5b2286dce2044c3f73f3b173ced2c Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sun, 28 Jun 2026 15:56:18 -0700 Subject: [PATCH] Add `boolinator` The core functionality of this crate now exists as `bool::then`, `bool::then_some`, `bool::ok_or`, and `bool::ok_or_else`. Some of the other combinators don't exist directly, so this is a partial replacement, though it may suffice for many users. --- data/boolinator.toml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data/boolinator.toml diff --git a/data/boolinator.toml b/data/boolinator.toml new file mode 100644 index 0000000..2fde7e3 --- /dev/null +++ b/data/boolinator.toml @@ -0,0 +1,13 @@ +description = """ +`bool::then` and `bool::then_some` support conversion to `Option`, superseding \ +this crate's `as_some` and `as_some_from`. + +`bool::ok_or` and `bool::ok_or_else` support conversion to `Result`, \ +superseding this crate's `ok_or` and `ok_or_else`. + +`.then(())` supersedes `as_option`. + +The other combinators have no direct single-function equivalents, though some \ +can be expressed straightforwardly given the above `std` functionality. +""" +url = "https://doc.rust-lang.org/std/primitive.bool.html#implementations"