1
1
use std:: io:: prelude:: * ;
2
2
3
+ use crate :: core:: resolver:: encode:: EncodableResolve ;
3
4
use crate :: core:: resolver:: encode:: into_resolve;
4
- use crate :: core:: { Resolve , ResolveVersion , Workspace , resolver } ;
5
+ use crate :: core:: { Resolve , ResolveVersion , Workspace } ;
5
6
use crate :: util:: Filesystem ;
6
7
use crate :: util:: errors:: CargoResult ;
7
8
@@ -23,7 +24,7 @@ pub fn load_pkg_lockfile(ws: &Workspace<'_>) -> CargoResult<Option<Resolve>> {
23
24
. with_context ( || format ! ( "failed to read file: {}" , f. path( ) . display( ) ) ) ?;
24
25
25
26
let resolve = ( || -> CargoResult < Option < Resolve > > {
26
- let v: resolver :: EncodableResolve = toml:: from_str ( & s) ?;
27
+ let v: EncodableResolve = toml:: from_str ( & s) ?;
27
28
Ok ( Some ( into_resolve ( v, & s, ws) ?) )
28
29
} ) ( )
29
30
. with_context ( || format ! ( "failed to parse lock file at: {}" , f. path( ) . display( ) ) ) ?;
@@ -207,8 +208,8 @@ fn are_equal_lockfiles(orig: &str, current: &str, ws: &Workspace<'_>) -> bool {
207
208
// common case where we can update lock files.
208
209
if !ws. gctx ( ) . lock_update_allowed ( ) {
209
210
let res: CargoResult < bool > = ( || {
210
- let old: resolver :: EncodableResolve = toml:: from_str ( orig) ?;
211
- let new: resolver :: EncodableResolve = toml:: from_str ( current) ?;
211
+ let old: EncodableResolve = toml:: from_str ( orig) ?;
212
+ let new: EncodableResolve = toml:: from_str ( current) ?;
212
213
Ok ( into_resolve ( old, orig, ws) ? == into_resolve ( new, current, ws) ?)
213
214
} ) ( ) ;
214
215
if let Ok ( true ) = res {
0 commit comments