1
- use std:: borrow:: Cow ;
2
1
use std:: cell:: RefCell ;
3
2
use std:: collections:: hash_map:: { Entry , HashMap } ;
4
3
use std:: collections:: { BTreeMap , BTreeSet , HashSet } ;
@@ -366,7 +365,7 @@ impl<'cfg> Workspace<'cfg> {
366
365
/// Returns the root `[patch]` section of this workspace.
367
366
///
368
367
/// This may be from a virtual crate or an actual crate.
369
- pub fn root_patch ( & self ) -> Cow < ' _ , HashMap < Url , Vec < Dependency > > > {
368
+ pub fn root_patch ( & self ) -> HashMap < Url , Vec < Dependency > > {
370
369
let from_manifest = match self . root_maybe ( ) {
371
370
MaybePackage :: Package ( p) => p. manifest ( ) . patch ( ) ,
372
371
MaybePackage :: Virtual ( vm) => vm. patch ( ) ,
@@ -377,10 +376,10 @@ impl<'cfg> Workspace<'cfg> {
377
376
. patch ( )
378
377
. expect ( "config [patch] was never parsed" ) ;
379
378
if from_config. is_empty ( ) {
380
- return Cow :: Borrowed ( from_manifest) ;
379
+ return from_manifest. clone ( ) ;
381
380
}
382
381
if from_manifest. is_empty ( ) {
383
- return Cow :: Borrowed ( from_config) ;
382
+ return from_config. clone ( ) ;
384
383
}
385
384
386
385
// We could just chain from_manifest and from_config,
@@ -405,7 +404,7 @@ impl<'cfg> Workspace<'cfg> {
405
404
combined. insert ( url. clone ( ) , cdeps. clone ( ) ) ;
406
405
}
407
406
}
408
- Cow :: Owned ( combined)
407
+ combined
409
408
}
410
409
411
410
/// Returns an iterator over all packages in this workspace
0 commit comments