@@ -551,14 +551,15 @@ impl TryFrom<TokenStream> for TypleMacro {
551
551
/// ```rust
552
552
/// # use typle::typle;
553
553
/// #[typle(Tuple for 0..=12)]
554
- /// fn check<T: Tuple<&str>>(t: T) -> [bool; 2] {
555
- /// [
556
- /// typle_all!(i in ..T::LEN => t[[i]].len() > 5),
557
- /// typle_any!(i in ..T::LEN => t[[i]].len() > 5),
558
- /// ]
554
+ /// fn all_long<T: Tuple<&str>>(t: T) -> bool {
555
+ /// typle_all!(i in ..T::LEN => t[[i]].len() > 5)
559
556
/// }
560
- /// assert_eq!(check(("the", "longest", "word")), [false, true]);
561
- /// assert_eq!(check(()), [true, false]);
557
+ /// // Return `true` if all words meet the criteria.
558
+ /// assert_eq!(all_long(("longest", "phrase")), true);
559
+ /// // Return `false` if any words fail to meet the criteria.
560
+ /// assert_eq!(all_long(("the", "longest", "word")), false);
561
+ /// // Return `true` for an empty tuple as no words fail to meet the criteria.
562
+ /// assert_eq!(all_long(()), true);
562
563
/// ```
563
564
///
564
565
#[ proc_macro]
@@ -576,14 +577,15 @@ pub fn typle_all(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
576
577
/// ```rust
577
578
/// # use typle::typle;
578
579
/// #[typle(Tuple for 0..=12)]
579
- /// fn check<T: Tuple<&str>>(t: T) -> [bool; 2] {
580
- /// [
581
- /// typle_all!(i in ..T::LEN => t[[i]].len() > 5),
582
- /// typle_any!(i in ..T::LEN => t[[i]].len() > 5),
583
- /// ]
580
+ /// fn any_long<T: Tuple<&str>>(t: T) -> bool {
581
+ /// typle_any!(i in ..T::LEN => t[[i]].len() > 5)
584
582
/// }
585
- /// assert_eq!(check(("the", "longest", "word")), [false, true]);
586
- /// assert_eq!(check(()), [true, false]);
583
+ /// // Return `true` if any word meets the criteria.
584
+ /// assert_eq!(any_long(("the", "longest", "word")), true);
585
+ /// // Return `false` if no words meet the criteria.
586
+ /// assert_eq!(any_long(("short", "words")), false);
587
+ /// // Return `false` for an empty tuple as no words meet the criteria.
588
+ /// assert_eq!(any_long(()), false);
587
589
/// ```
588
590
///
589
591
#[ proc_macro]
0 commit comments