]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix rustc nightly compiler error.
authorMatt Corallo <git@bluematt.me>
Sun, 19 Jan 2020 05:49:18 +0000 (00:49 -0500)
committerMatt Corallo <git@bluematt.me>
Mon, 4 May 2020 17:58:13 +0000 (13:58 -0400)
This works around a regression in nightly rustc that prevents type
inference from working properly.

lightning/src/ln/router.rs

index 037303d917cfa8a911ddc0cacbe8cb7ae583b819..480acfcb659208e926d265ad6bff05aa7da22b10 100644 (file)
@@ -1571,7 +1571,7 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 200);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (13 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]); // it should also override our view of their features
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node3);
                        assert_eq!(route.paths[0][1].short_channel_id, 13);
@@ -1620,7 +1620,7 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 200);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (13 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]); // it should also override our view of their features
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node3);
                        assert_eq!(route.paths[0][1].short_channel_id, 13);
@@ -1687,7 +1687,7 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 200);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (13 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]);
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node3);
                        assert_eq!(route.paths[0][1].short_channel_id, 13);
@@ -1758,8 +1758,8 @@ mod tests {
                        assert_eq!(route.paths[0][4].short_channel_id, 8);
                        assert_eq!(route.paths[0][4].fee_msat, 100);
                        assert_eq!(route.paths[0][4].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                { // Simple test with outbound channel to 4 to test that last_hops and first_hops connect
@@ -1782,14 +1782,14 @@ mod tests {
                        assert_eq!(route.paths[0][0].fee_msat, 0);
                        assert_eq!(route.paths[0][0].cltv_expiry_delta, (8 << 8) | 1);
                        assert_eq!(route.paths[0][0].node_features.le_flags(), &vec![0b11]);
-                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::new()); // No feature flags will meet the relevant-to-channel conversion
+                       assert_eq!(route.paths[0][0].channel_features.le_flags(), &Vec::<u8>::new()); // No feature flags will meet the relevant-to-channel conversion
 
                        assert_eq!(route.paths[0][1].pubkey, node7);
                        assert_eq!(route.paths[0][1].short_channel_id, 8);
                        assert_eq!(route.paths[0][1].fee_msat, 100);
                        assert_eq!(route.paths[0][1].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][1].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][1].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][1].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][1].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                last_hops[0].fee_base_msat = 1000;
@@ -1825,8 +1825,8 @@ mod tests {
                        assert_eq!(route.paths[0][3].short_channel_id, 10);
                        assert_eq!(route.paths[0][3].fee_msat, 100);
                        assert_eq!(route.paths[0][3].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][3].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][3].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][3].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][3].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                { // ...but still use 8 for larger payments as 6 has a variable feerate
@@ -1867,8 +1867,8 @@ mod tests {
                        assert_eq!(route.paths[0][4].short_channel_id, 8);
                        assert_eq!(route.paths[0][4].fee_msat, 2000);
                        assert_eq!(route.paths[0][4].cltv_expiry_delta, 42);
-                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::new()); // We dont pass flags in from invoices yet
-                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::new()); // We can't learn any flags from invoices, sadly
+                       assert_eq!(route.paths[0][4].node_features.le_flags(), &Vec::<u8>::new()); // We dont pass flags in from invoices yet
+                       assert_eq!(route.paths[0][4].channel_features.le_flags(), &Vec::<u8>::new()); // We can't learn any flags from invoices, sadly
                }
 
                { // Test Router serialization/deserialization