From 4bdad38eee92e48a0beaf252a89cfc1e4128a4ed Mon Sep 17 00:00:00 2001 From: Wictor Lund Date: Thu, 1 Dec 2016 22:07:03 +0200 Subject: [PATCH] Added test for trait From for Ratio where T: Clone + Integer. --- rational/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/rational/src/lib.rs b/rational/src/lib.rs index ae01b2c..6349266 100644 --- a/rational/src/lib.rs +++ b/rational/src/lib.rs @@ -745,6 +745,7 @@ mod test { assert_eq!(_1_2, Ratio::new(1, 2)); assert_eq!(_3_2, Ratio::new(3, 2)); assert_eq!(_NEG1_2, Ratio::new(-1, 2)); + assert_eq!(_2, From::from(2)); } #[test]