File tree Expand file tree Collapse file tree 5 files changed +10
-12
lines changed
Expand file tree Collapse file tree 5 files changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -81,8 +81,7 @@ impl Cache for FileCache {
8181 let mut file = tokio:: fs:: File :: create ( & path) . await . map_err ( |e| {
8282 Error :: CacheError ( anyhow:: anyhow!( "Unable to create file for cache {e}" ) )
8383 } ) ?;
84- let mut buf =
85- StreamReader :: new ( data. map_err ( |e| std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , e) ) ) ;
84+ let mut buf = StreamReader :: new ( data. map_err ( std:: io:: Error :: other) ) ;
8685 tokio:: io:: copy ( & mut buf, & mut file)
8786 . await
8887 . map_err ( |e| Error :: CacheError ( e. into ( ) ) )
Original file line number Diff line number Diff line change @@ -170,10 +170,9 @@ impl Client {
170170 let ( mut data, p, v) = tokio:: task:: spawn_blocking ( || resolve_package ( data) )
171171 . await
172172 . map_err ( |e| {
173- crate :: Error :: IoError ( std:: io:: Error :: new (
174- std:: io:: ErrorKind :: Other ,
175- format ! ( "Error when performing blocking IO: {e:?}" ) ,
176- ) )
173+ crate :: Error :: IoError ( std:: io:: Error :: other ( format ! (
174+ "Error when performing blocking IO: {e:?}"
175+ ) ) )
177176 } ) ??;
178177 // We must rewind the reader because we read to the end to parse the component.
179178 data. rewind ( ) . await ?;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ impl Ord for VersionInfo {
2626
2727impl PartialOrd for VersionInfo {
2828 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
29- Some ( self . version . cmp ( & other. version ) )
29+ Some ( self . cmp ( other) )
3030 }
3131}
3232
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ impl RegistryMetadata {
6363 }
6464
6565 /// Returns an iterator of protocols configured by the registry.
66- pub fn configured_protocols ( & self ) -> impl Iterator < Item = Cow < str > > {
66+ pub fn configured_protocols ( & self ) -> impl Iterator < Item = Cow < ' _ , str > > {
6767 let mut protos: BTreeSet < String > = self . protocol_configs . keys ( ) . cloned ( ) . collect ( ) ;
6868 // Backward-compatibility aliases
6969 if self . oci_registry . is_some ( ) || self . oci_namespace_prefix . is_some ( ) {
Original file line number Diff line number Diff line change @@ -126,9 +126,9 @@ impl RegistryResolution {
126126 )
127127 . await ?;
128128
129- Ok ( tokio_util:: io:: StreamReader :: new ( stream . map_err ( |e| {
130- std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e )
131- } ) ) )
129+ Ok ( tokio_util:: io:: StreamReader :: new (
130+ stream . map_err ( std:: io:: Error :: other ) ,
131+ ) )
132132 }
133133}
134134
@@ -181,7 +181,7 @@ impl DependencyResolution {
181181 }
182182
183183 /// Decodes the resolved dependency.
184- pub async fn decode ( & self ) -> Result < DecodedDependency > {
184+ pub async fn decode ( & self ) -> Result < DecodedDependency < ' _ > > {
185185 // If the dependency path is a directory, assume it contains wit to parse as a package.
186186 let bytes = match self {
187187 DependencyResolution :: Local ( LocalResolution { path, .. } )
You can’t perform that action at this time.
0 commit comments