]> 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>
Sun, 1 Mar 2020 04:26:16 +0000 (23:26 -0500)
This works around a regression in nightly rustc that prevents type
inference from working properly.

lightning/src/ln/router.rs

index bb2ea61a80bc8bd511afe8adf954673d8754e208..e99a5f76e66a595ef6fb03ca57a44ca44cb03ce3 100644 (file)
@@ -1564,7 +1564,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);
@@ -1613,7 +1613,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);
@@ -1680,7 +1680,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);
@@ -1751,8 +1751,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
@@ -1775,14 +1775,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;
@@ -1818,8 +1818,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
@@ -1860,8 +1860,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