Skip to content

Commit efc42e1

Browse files
committed
refactor: change imports of encode
simplifies the moving over of the schemas
1 parent 535f773 commit efc42e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cargo/ops/lockfile.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use std::io::prelude::*;
22

3+
use crate::core::resolver::encode::EncodableResolve;
34
use crate::core::resolver::encode::into_resolve;
4-
use crate::core::{Resolve, ResolveVersion, Workspace, resolver};
5+
use crate::core::{Resolve, ResolveVersion, Workspace};
56
use crate::util::Filesystem;
67
use crate::util::errors::CargoResult;
78

@@ -23,7 +24,7 @@ pub fn load_pkg_lockfile(ws: &Workspace<'_>) -> CargoResult<Option<Resolve>> {
2324
.with_context(|| format!("failed to read file: {}", f.path().display()))?;
2425

2526
let resolve = (|| -> CargoResult<Option<Resolve>> {
26-
let v: resolver::EncodableResolve = toml::from_str(&s)?;
27+
let v: EncodableResolve = toml::from_str(&s)?;
2728
Ok(Some(into_resolve(v, &s, ws)?))
2829
})()
2930
.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 {
207208
// common case where we can update lock files.
208209
if !ws.gctx().lock_update_allowed() {
209210
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)?;
212213
Ok(into_resolve(old, orig, ws)? == into_resolve(new, current, ws)?)
213214
})();
214215
if let Ok(true) = res {

0 commit comments

Comments
 (0)