match literals in fp macro
authoralfadur
Tue, 22 Jan 2019 20:35:11 +0300
changeset 14685 def1b9870078
parent 14684 fb73852e6f4d
child 14686 6608a68ca0ee
match literals in fp macro
rust/fpnum/src/lib.rs
--- a/rust/fpnum/src/lib.rs	Tue Jan 22 18:17:19 2019 +0100
+++ b/rust/fpnum/src/lib.rs	Tue Jan 22 20:35:11 2019 +0300
@@ -295,16 +295,16 @@
 
 #[macro_export]
 macro_rules! fp {
-    (-$n: tt / $d: tt) => {
+    (-$n: literal / $d: literal) => {
         FPNum::new(-$n, $d)
     };
-    ($n: tt / $d: tt) => {
+    ($n: literal / $d: literal) => {
         FPNum::new($n, $d)
     };
-    (-$n: tt) => {
+    (-$n: literal) => {
         FPNum::from(-$n)
     };
-    ($n: tt) => {
+    ($n: literal) => {
         FPNum::from($n)
     };
 }