You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description = "Boost readability by writing multicomparison expressions like `if any_of!({a,b,c}>=5) {...}` while keeping the benefits of hand-written code."
@@ -53,7 +55,7 @@ And finally, you can rest assured in the warm and fuzzy feeling that this crate
53
55
Use the macros by writing `any_of!({/*list of expressions*/} operator rhs)`,
54
56
where operator can be any of the binary comparison operators,
55
57
i.e. `==`, `!=`, `<=`, `<`, `>`, and `>=`. The list of expressions on the left hand side
56
-
is comma separated without a trailing comma. The right hand side is an expression as well.
58
+
is comma separated. The right hand side of the comparison is an expression as well.
57
59
58
60
The list of expressions can have a variadic number of elements but must have at least one.
59
61
It must always be enclosed in curly braces. The expressions on the left hand side need not be
@@ -64,4 +66,4 @@ The same goes for the `all_of` and `none_of` macros. Check the docs for more inf
64
66
65
67
## Links
66
68
67
-
This library is inspired by Björn Fahller's [DRY comparisons](https://github.com/rollbear/dry-comparisons) Modern C++ library, which I read about [in this blog post](https://www.fluentcpp.com/2020/01/03/dry-comparisons-a-c-library-to-shorten-redundant-if-statements/) on Jonathan Boccara's blog.
69
+
This library is inspired by Björn Fahller's [DRY comparisons](https://github.com/rollbear/dry-comparisons) Modern C++ library, which I read about [in this blog post](https://www.fluentcpp.com/2020/01/03/dry-comparisons-a-c-library-to-shorten-redundant-if-statements/) on Jonathan Boccara's blog.
Copy file name to clipboardexpand all lines: fluent-comparisons-macros/src/lib.rs
+11-37
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
///! This crate contains the macros for the fluent-comparisons crate
1
+
//! This crate contains the macros for the fluent-comparisons crate
2
2
3
3
#[macro_export]
4
4
#[doc(hidden)]
@@ -39,7 +39,7 @@ macro_rules! __check_operator {
39
39
///
40
40
/// For the basic use case we compare a set of values against a common right hand side. Invoke the macro using
41
41
/// `any_of!({/*list of expressions*/} operator rhs)`, where operator can be any of the binary comparison operators, i.e.
42
-
/// `==`, `!=`, `<=`, `<`, `>`, and `>=`. The list of expressions on the left hand side is comma separated without a trailing comma. The right hand side
42
+
/// `==`, `!=`, `<=`, `<`, `>`, and `>=`. The list of expressions on the left hand side is comma separated. The right hand side
43
43
/// is an expression as well.
44
44
///
45
45
/// The list of expressions can have a variadic number of elements but must have at least one. It must always be enclosed in
0 commit comments