@@ -3450,15 +3450,15 @@ mod tests {
3450
3450
let s = remove_ws ( & schema) ;
3451
3451
if !p. contains ( & s) {
3452
3452
package_json. replace_range ( start..end, & schema) ;
3453
- ensure_file_contents ( & package_json_path, & package_json)
3453
+ ensure_file_contents ( package_json_path. as_std_path ( ) , & package_json)
3454
3454
}
3455
3455
}
3456
3456
3457
3457
#[ test]
3458
3458
fn generate_config_documentation ( ) {
3459
3459
let docs_path = project_root ( ) . join ( "docs/user/generated_config.adoc" ) ;
3460
3460
let expected = FullConfigInput :: manual ( ) ;
3461
- ensure_file_contents ( & docs_path, & expected) ;
3461
+ ensure_file_contents ( docs_path. as_std_path ( ) , & expected) ;
3462
3462
}
3463
3463
3464
3464
fn remove_ws ( text : & str ) -> String {
@@ -3467,13 +3467,8 @@ mod tests {
3467
3467
3468
3468
#[ test]
3469
3469
fn proc_macro_srv_null ( ) {
3470
- let mut config = Config :: new (
3471
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3472
- Default :: default ( ) ,
3473
- vec ! [ ] ,
3474
- None ,
3475
- None ,
3476
- ) ;
3470
+ let mut config =
3471
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3477
3472
3478
3473
let mut change = ConfigChange :: default ( ) ;
3479
3474
change. change_client_config ( serde_json:: json!( {
@@ -3487,32 +3482,22 @@ mod tests {
3487
3482
3488
3483
#[ test]
3489
3484
fn proc_macro_srv_abs ( ) {
3490
- let mut config = Config :: new (
3491
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3492
- Default :: default ( ) ,
3493
- vec ! [ ] ,
3494
- None ,
3495
- None ,
3496
- ) ;
3485
+ let mut config =
3486
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3497
3487
let mut change = ConfigChange :: default ( ) ;
3498
3488
change. change_client_config ( serde_json:: json!( {
3499
3489
"procMacro" : {
3500
- "server" : project_root( ) . display ( ) . to_string( ) ,
3490
+ "server" : project_root( ) . to_string( ) ,
3501
3491
} } ) ) ;
3502
3492
3503
3493
( config, _, _) = config. apply_change ( change) ;
3504
- assert_eq ! ( config. proc_macro_srv( ) , Some ( AbsPathBuf :: try_from ( project_root( ) ) . unwrap ( ) ) ) ;
3494
+ assert_eq ! ( config. proc_macro_srv( ) , Some ( AbsPathBuf :: assert ( project_root( ) ) ) ) ;
3505
3495
}
3506
3496
3507
3497
#[ test]
3508
3498
fn proc_macro_srv_rel ( ) {
3509
- let mut config = Config :: new (
3510
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3511
- Default :: default ( ) ,
3512
- vec ! [ ] ,
3513
- None ,
3514
- None ,
3515
- ) ;
3499
+ let mut config =
3500
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3516
3501
3517
3502
let mut change = ConfigChange :: default ( ) ;
3518
3503
@@ -3531,13 +3516,8 @@ mod tests {
3531
3516
3532
3517
#[ test]
3533
3518
fn cargo_target_dir_unset ( ) {
3534
- let mut config = Config :: new (
3535
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3536
- Default :: default ( ) ,
3537
- vec ! [ ] ,
3538
- None ,
3539
- None ,
3540
- ) ;
3519
+ let mut config =
3520
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3541
3521
3542
3522
let mut change = ConfigChange :: default ( ) ;
3543
3523
@@ -3554,13 +3534,8 @@ mod tests {
3554
3534
3555
3535
#[ test]
3556
3536
fn cargo_target_dir_subdir ( ) {
3557
- let mut config = Config :: new (
3558
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3559
- Default :: default ( ) ,
3560
- vec ! [ ] ,
3561
- None ,
3562
- None ,
3563
- ) ;
3537
+ let mut config =
3538
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3564
3539
3565
3540
let mut change = ConfigChange :: default ( ) ;
3566
3541
change. change_client_config ( serde_json:: json!( {
@@ -3577,13 +3552,8 @@ mod tests {
3577
3552
3578
3553
#[ test]
3579
3554
fn cargo_target_dir_relative_dir ( ) {
3580
- let mut config = Config :: new (
3581
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3582
- Default :: default ( ) ,
3583
- vec ! [ ] ,
3584
- None ,
3585
- None ,
3586
- ) ;
3555
+ let mut config =
3556
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3587
3557
3588
3558
let mut change = ConfigChange :: default ( ) ;
3589
3559
change. change_client_config ( serde_json:: json!( {
@@ -3603,13 +3573,8 @@ mod tests {
3603
3573
3604
3574
#[ test]
3605
3575
fn toml_unknown_key ( ) {
3606
- let config = Config :: new (
3607
- AbsPathBuf :: try_from ( project_root ( ) ) . unwrap ( ) ,
3608
- Default :: default ( ) ,
3609
- vec ! [ ] ,
3610
- None ,
3611
- None ,
3612
- ) ;
3576
+ let config =
3577
+ Config :: new ( AbsPathBuf :: assert ( project_root ( ) ) , Default :: default ( ) , vec ! [ ] , None , None ) ;
3613
3578
3614
3579
let mut change = ConfigChange :: default ( ) ;
3615
3580
0 commit comments