File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ impl IndexCache {
3131 /// Determines if the specified crate exists in the crates.io index
3232 #[ inline]
3333 pub fn has_krate ( & mut self , registry : & Url , name : & str ) -> CargoResult < bool > {
34- self . index ( registry) ?. has_krate ( name)
34+ self . index ( registry)
35+ . with_context ( || format ! ( "failed to look up {name}" ) ) ?
36+ . has_krate ( name)
3537 }
3638
3739 /// Determines if the specified crate version exists in the crates.io index
@@ -42,17 +44,23 @@ impl IndexCache {
4244 name : & str ,
4345 version : & str ,
4446 ) -> CargoResult < Option < bool > > {
45- self . index ( registry) ?. has_krate_version ( name, version)
47+ self . index ( registry)
48+ . with_context ( || format ! ( "failed to look up {name}@{version}" ) ) ?
49+ . has_krate_version ( name, version)
4650 }
4751
4852 #[ inline]
4953 pub fn update_krate ( & mut self , registry : & Url , name : & str ) -> CargoResult < ( ) > {
50- self . index ( registry) ?. update_krate ( name) ;
54+ self . index ( registry)
55+ . with_context ( || format ! ( "failed to look up {name}" ) ) ?
56+ . update_krate ( name) ;
5157 Ok ( ( ) )
5258 }
5359
5460 pub fn krate ( & mut self , registry : & Url , name : & str ) -> CargoResult < Option < IndexKrate > > {
55- self . index ( registry) ?. krate ( name)
61+ self . index ( registry)
62+ . with_context ( || format ! ( "failed to look up {name}" ) ) ?
63+ . krate ( name)
5664 }
5765
5866 fn index < ' s > ( & ' s mut self , registry : & Url ) -> CargoResult < & ' s mut AnyIndexCache > {
You can’t perform that action at this time.
0 commit comments