@@ -323,7 +323,8 @@ fn add_crate_to_source_distribution(
323
323
324
324
let local_deps_folder = if cargo_toml_in_subdir {
325
325
let level = abs_manifest_dir
326
- . strip_prefix ( pyproject_dir) ?
326
+ . strip_prefix ( pyproject_dir)
327
+ . unwrap ( )
327
328
. components ( )
328
329
. count ( ) ;
329
330
format ! ( "{}{}" , "../" . repeat( level) , LOCAL_DEPENDENCIES_FOLDER )
@@ -342,7 +343,7 @@ fn add_crate_to_source_distribution(
342
343
writer. add_directory ( prefix) ?;
343
344
344
345
let cargo_toml = if cargo_toml_in_subdir {
345
- let relative_manifest_path = abs_manifest_path. strip_prefix ( pyproject_dir) ? ;
346
+ let relative_manifest_path = abs_manifest_path. strip_prefix ( pyproject_dir) . unwrap ( ) ;
346
347
prefix. join ( relative_manifest_path)
347
348
} else {
348
349
prefix. join ( manifest_path. file_name ( ) . unwrap ( ) )
@@ -482,9 +483,9 @@ pub fn source_distribution(
482
483
if cargo_lock_required || cargo_lock_path. exists ( ) {
483
484
let project_root = pyproject_toml_path. parent ( ) . unwrap ( ) ;
484
485
let relative_cargo_lock = if cargo_lock_path. starts_with ( project_root) {
485
- cargo_lock_path. strip_prefix ( project_root) ?
486
+ cargo_lock_path. strip_prefix ( project_root) . unwrap ( )
486
487
} else {
487
- cargo_lock_path. strip_prefix ( & abs_manifest_dir) ?
488
+ cargo_lock_path. strip_prefix ( & abs_manifest_dir) . unwrap ( )
488
489
} ;
489
490
writer. add_file ( root_dir. join ( relative_cargo_lock) , & cargo_lock_path) ?;
490
491
} else {
@@ -512,7 +513,7 @@ pub fn source_distribution(
512
513
continue ;
513
514
}
514
515
let source = fs:: canonicalize ( source) ?;
515
- let target = root_dir. join ( source. strip_prefix ( & pyproject_dir) ? ) ;
516
+ let target = root_dir. join ( source. strip_prefix ( & pyproject_dir) . unwrap ( ) ) ;
516
517
if source. is_dir ( ) {
517
518
writer. add_directory ( target) ?;
518
519
} else {
@@ -542,7 +543,7 @@ pub fn source_distribution(
542
543
. expect ( "No files found for pattern" )
543
544
. filter_map ( Result :: ok)
544
545
{
545
- let target = root_dir. join ( & source. strip_prefix ( pyproject_dir) ? ) ;
546
+ let target = root_dir. join ( & source. strip_prefix ( pyproject_dir) . unwrap ( ) ) ;
546
547
if source. is_dir ( ) {
547
548
writer. add_directory ( target) ?;
548
549
} else {
0 commit comments