diff options
| author | Andreas Grois <andi@grois.info> | 2023-04-02 21:38:17 +0200 |
|---|---|---|
| committer | Andreas Grois <andi@grois.info> | 2023-04-02 21:53:09 +0200 |
| commit | 418f514fc46f45ae2901753e3398adb33664bed9 (patch) | |
| tree | f8edc0df880a00d4964877d4b835c0eb9e481210 /tests/trivial_lifetime.rs | |
| parent | 02d01dd1b544a576caeb8da42912c5db904b94bd (diff) | |
I, for one, welcome our new clippy overlords
Diffstat (limited to 'tests/trivial_lifetime.rs')
| -rw-r--r-- | tests/trivial_lifetime.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/trivial_lifetime.rs b/tests/trivial_lifetime.rs index fe05234..4f7d094 100644 --- a/tests/trivial_lifetime.rs +++ b/tests/trivial_lifetime.rs @@ -1,3 +1,5 @@ +#![deny(clippy::pedantic)] +#![deny(clippy::all)] //! Tests if a trivial functor, which's lifetime depends on the mapping function, works. use std::rc::Rc; use higher::{Functor, Bind}; @@ -22,8 +24,8 @@ free!(<'a>, FreeTriv<'a,A,B>, TrivWithLifetime<'a,FreeTriv<'a,A,B>,B>); #[test] fn test_trivial_with_lifetime(){ - let f = FreeTriv::lift_f(TrivWithLifetime{next : Rc::new(|x : i32| x.abs() as u32)}); - let f = f.bind(|x| FreeTriv::Pure(x)); + let f = FreeTriv::lift_f(TrivWithLifetime{next : Rc::new(i32::unsigned_abs)}); + let f = f.bind(FreeTriv::Pure); match f { FreeTriv::Free(f) => { let n = (f.next)(-4); @@ -32,6 +34,6 @@ fn test_trivial_with_lifetime(){ FreeTriv::Free(_) => unreachable!(), } }, - _ => unreachable!() + FreeTriv::Pure(_) => unreachable!() } }
\ No newline at end of file |
