Define Payee abstraction for use in get_route
[rust-lightning] / lightning-invoice / src / lib.rs
index 61e394da6dba4ef70979a5dae1d673ce2b483732..0f125362c3a1877e0fdc7e1d07c5500e95e48be4 100644 (file)
@@ -1208,10 +1208,10 @@ impl Invoice {
        }
 
        /// Returns a list of all routes included in the invoice as the underlying hints
-       pub fn route_hints(&self) -> Vec<&RouteHint> {
+       pub fn route_hints(&self) -> Vec<RouteHint> {
                find_all_extract!(
                        self.signed_invoice.known_tagged_fields(), TaggedField::PrivateRoute(ref x), x
-               ).map(|route| &**route).collect()
+               ).map(|route| (**route).clone()).collect()
        }
 
        /// Returns the currency for which the invoice was issued