@@ -7,7 +7,7 @@ use async_stream::try_stream;
77use clap:: { Parser , Subcommand } ;
88use futures_core:: TryStream ;
99use futures_util:: { TryStreamExt , pin_mut} ;
10- use stac:: { Assets , Collection , Href , Item , Links , Migrate , SelfHref , geoparquet:: Compression } ;
10+ use stac:: { Assets , Collection , Item , Links , Migrate , SelfHref , geoparquet:: Compression } ;
1111use stac_api:: { GetItems , GetSearch , Search } ;
1212use stac_io:: { Format , StacStore , Validate } ;
1313use stac_server:: Backend ;
@@ -527,7 +527,7 @@ impl Rustac {
527527 let href = href. and_then ( |s| if s == "-" { None } else { Some ( s) } ) ;
528528 let format = self . input_format ( href) ;
529529 if let Some ( href) = href {
530- let ( store, path) = stac_io:: parse_href_opts ( Href :: from ( href) , self . opts ( ) ) ?;
530+ let ( store, path) = stac_io:: parse_href_opts ( href, self . opts ( ) ) ?;
531531 let value: stac:: Value = store. get_format ( path, format) . await ?;
532532 Ok ( value)
533533 } else {
@@ -542,7 +542,7 @@ impl Rustac {
542542 let href = href. and_then ( |s| if s == "-" { None } else { Some ( s) } ) ;
543543 let format = self . output_format ( href) ;
544544 if let Some ( href) = href {
545- let ( store, path) = stac_io:: parse_href_opts ( Href :: from ( href) , self . opts ( ) ) ?;
545+ let ( store, path) = stac_io:: parse_href_opts ( href, self . opts ( ) ) ?;
546546 let _ = match value {
547547 Value :: Json ( json) => store. put_format ( path, json, format) . await ?,
548548 Value :: Stac ( stac) => store. put_format ( path, stac, format) . await ?,
@@ -742,7 +742,7 @@ async fn crawl(value: stac::Value, store: StacStore) -> impl TryStream<Item = Re
742742 . cloned( )
743743 {
744744 let store = store. clone( ) ;
745- let url = Url :: try_from ( link. href) ?;
745+ let url = Url :: parse ( & link. href) ?;
746746 join_set. spawn( async move {
747747 let value: stac:: Value = store. get( url. path( ) ) . await ?;
748748 Ok ( value)
@@ -754,15 +754,17 @@ async fn crawl(value: stac::Value, store: StacStore) -> impl TryStream<Item = Re
754754 }
755755 }
756756 Item ( mut item) => {
757- if let Some ( self_href) = item. self_href( ) . cloned( ) {
758- item. make_assets_absolute( self_href) ?;
757+ if let Some ( self_href) = item. self_href( ) {
758+ let self_href= self_href. to_string( ) ;
759+ item. make_assets_absolute( & self_href) ?;
759760 }
760761 yield item;
761762 }
762763 ItemCollection ( item_collection) => {
763764 for mut item in item_collection. items {
764- if let Some ( self_href) = item. self_href( ) . cloned( ) {
765- item. make_assets_absolute( self_href) ?;
765+ if let Some ( self_href) = item. self_href( ) {
766+ let self_href = self_href. to_string( ) ;
767+ item. make_assets_absolute( & self_href) ?;
766768 }
767769 yield item;
768770 }
0 commit comments