11//! Tools for gathering various kinds of metadata (Cargo.lock, Cargo metadata, Crate Index info).
22
33mod cargo_bin;
4+ mod cargo_toml_path;
45mod cargo_tree_resolver;
56mod dependency;
67mod metadata_annotation;
@@ -12,12 +13,12 @@ use std::path::{Path, PathBuf};
1213use std:: str:: FromStr ;
1314
1415use anyhow:: { bail, Context , Result } ;
15- use camino:: Utf8Path ;
1616use cargo_lock:: Lockfile as CargoLockfile ;
1717use cargo_metadata:: Metadata as CargoMetadata ;
1818use tracing:: debug;
1919
2020pub ( crate ) use self :: cargo_bin:: * ;
21+ pub ( crate ) use self :: cargo_toml_path:: * ;
2122pub ( crate ) use self :: cargo_tree_resolver:: * ;
2223pub ( crate ) use self :: dependency:: * ;
2324pub ( crate ) use self :: metadata_annotation:: * ;
@@ -190,13 +191,13 @@ impl LockGenerator {
190191 #[ tracing:: instrument( name = "LockGenerator::generate" , skip_all) ]
191192 pub ( crate ) fn generate (
192193 & self ,
193- manifest_path : & Utf8Path ,
194+ manifest_path : & CargoTomlPath ,
194195 existing_lock : & Option < PathBuf > ,
195196 update_request : & Option < CargoUpdateRequest > ,
196197 ) -> Result < cargo_lock:: Lockfile > {
197198 debug ! ( "Generating Cargo Lockfile for {}" , manifest_path) ;
198199
199- let manifest_dir = manifest_path. parent ( ) . unwrap ( ) ;
200+ let manifest_dir = manifest_path. parent ( ) ;
200201 let generated_lockfile_path = manifest_dir. join ( "Cargo.lock" ) ;
201202
202203 if let Some ( lock) = existing_lock {
@@ -304,9 +305,9 @@ impl VendorGenerator {
304305 }
305306 }
306307 #[ tracing:: instrument( name = "VendorGenerator::generate" , skip_all) ]
307- pub ( crate ) fn generate ( & self , manifest_path : & Utf8Path , output_dir : & Path ) -> Result < ( ) > {
308+ pub ( crate ) fn generate ( & self , manifest_path : & CargoTomlPath , output_dir : & Path ) -> Result < ( ) > {
308309 debug ! ( "Vendoring {} to {}" , manifest_path, output_dir. display( ) ) ;
309- let manifest_dir = manifest_path. parent ( ) . unwrap ( ) ;
310+ let manifest_dir = manifest_path. parent ( ) ;
310311
311312 // Simply invoke `cargo generate-lockfile`
312313 let output = self
0 commit comments