fn build_lock(ws: &Workspace<'_>) -> CargoResult<String> {
    let config = ws.config();
    let orig_resolve = ops::load_pkg_lockfile(ws)?;

    // Convert Package -> TomlManifest -> Manifest -> Package
    let orig_pkg = ws.current()?;
    let toml_manifest = Rc::new(
        orig_pkg
            .manifest()
            .original()
            .prepare_for_publish(config, orig_pkg.root())?,
    );
    let package_root = orig_pkg.root();
    let source_id = orig_pkg.package_id().source_id();
    let (manifest, _nested_paths) =
        TomlManifest::to_real_manifest(&toml_manifest, source_id, package_root, config)?;
    let new_pkg = Package::new(manifest, orig_pkg.manifest_path());

    // Regenerate Cargo.lock using the old one as a guide.
    let tmp_ws = Workspace::ephemeral(new_pkg, ws.config(), None, true)?;
    let (pkg_set, new_resolve) = ops::resolve_ws(&tmp_ws)?;

    if let Some(orig_resolve) = orig_resolve {
        compare_resolve(config, tmp_ws.current()?, &orig_resolve, &new_resolve)?;
    }
    check_yanked(config, &pkg_set, &new_resolve)?;

    ops::resolve_to_string(&tmp_ws, &new_resolve)
}
/// Construct `Cargo.lock` for the package to be published.
Construct `Cargo.lock` for the package to be published.
Construct ` Cargo . lock ` for the package to be published .
fn build_lock(ws: &Workspace<'_>) -> CargoResult<String> {
    let config = ws.config();
    let orig_resolve = ops::load_pkg_lockfile(ws)?;
    // Convert Package -> TomlManifest -> Manifest -> Package
    let orig_pkg = ws.current()?;
    let toml_manifest = Rc::new(
        orig_pkg
            .manifest()
            .original()
            .prepare_for_publish(config, orig_pkg.root())?,
    );
    let package_root = orig_pkg.root();
    let source_id = orig_pkg.package_id().source_id();
    let (manifest, _nested_paths) =
        TomlManifest::to_real_manifest(&toml_manifest, source_id, package_root, config)?;
    let new_pkg = Package::new(manifest, orig_pkg.manifest_path());
    // Regenerate Cargo.lock using the old one as a guide.
    let tmp_ws = Workspace::ephemeral(new_pkg, ws.config(), None, true)?;
    let (pkg_set, new_resolve) = ops::resolve_ws(&tmp_ws)?;
    if let Some(orig_resolve) = orig_resolve {
        compare_resolve(config, tmp_ws.current()?, &orig_resolve, &new_resolve)?;
    }
    check_yanked(config, &pkg_set, &new_resolve)?;
    ops::resolve_to_string(&tmp_ws, &new_resolve)
}
fn build_lock ( ws : & Workspace < ' _ > ) -> CargoResult < String > { let config = ws . config ( ) ; let orig_resolve = ops :: load_pkg_lockfile ( ws ) ? ; // Convert Package -> TomlManifest -> Manifest -> Package let orig_pkg = ws . current ( ) ? ; let toml_manifest = Rc :: new ( orig_pkg . manifest ( ) . original ( ) . prepare_for_publish ( config , orig_pkg . root ( ) ) ? , ) ; let package_root = orig_pkg . root ( ) ; let source_id = orig_pkg . package_id ( ) . source_id ( ) ; let ( manifest , _nested_paths ) = TomlManifest :: to_real_manifest ( & toml_manifest , source_id , package_root , config ) ? ; let new_pkg = Package :: new ( manifest , orig_pkg . manifest_path ( ) ) ; // Regenerate Cargo.lock using the old one as a guide. let tmp_ws = Workspace :: ephemeral ( new_pkg , ws . config ( ) , None , true ) ? ; let ( pkg_set , new_resolve ) = ops :: resolve_ws ( & tmp_ws ) ? ; if let Some ( orig_resolve ) = orig_resolve { compare_resolve ( config , tmp_ws . current ( ) ? , & orig_resolve , & new_resolve ) ? ; } check_yanked ( config , & pkg_set , & new_resolve ) ? ; ops :: resolve_to_string ( & tmp_ws , & new_resolve ) }
Construct `Cargo.lock` for the package to be published.
Construct ` Cargo . lock ` for the package to be published .
ws
&Workspace<'_>
ws
&Workspace<'_>