File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
crates/cargo-test-support/src Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -571,6 +571,7 @@ pub struct Package {
571
571
local : bool ,
572
572
alternative : bool ,
573
573
invalid_json : bool ,
574
+ edition : Option < String > ,
574
575
resolver : Option < String > ,
575
576
proc_macro : bool ,
576
577
links : Option < String > ,
@@ -1251,6 +1252,7 @@ impl Package {
1251
1252
local : false ,
1252
1253
alternative : false ,
1253
1254
invalid_json : false ,
1255
+ edition : None ,
1254
1256
resolver : None ,
1255
1257
proc_macro : false ,
1256
1258
links : None ,
@@ -1387,6 +1389,12 @@ impl Package {
1387
1389
self
1388
1390
}
1389
1391
1392
+ /// Specifies `package.edition`
1393
+ pub fn edition ( & mut self , edition : & str ) -> & mut Package {
1394
+ self . edition = Some ( edition. to_owned ( ) ) ;
1395
+ self
1396
+ }
1397
+
1390
1398
/// Specifies `package.resolver`
1391
1399
pub fn resolver ( & mut self , resolver : & str ) -> & mut Package {
1392
1400
self . resolver = Some ( resolver. to_owned ( ) ) ;
@@ -1581,6 +1589,10 @@ impl Package {
1581
1589
manifest. push_str ( & format ! ( "rust-version = \" {}\" \n " , version) ) ;
1582
1590
}
1583
1591
1592
+ if let Some ( edition) = & self . edition {
1593
+ manifest. push_str ( & format ! ( "edition = \" {}\" \n " , edition) ) ;
1594
+ }
1595
+
1584
1596
if let Some ( resolver) = & self . resolver {
1585
1597
manifest. push_str ( & format ! ( "resolver = \" {}\" \n " , resolver) ) ;
1586
1598
}
You can’t perform that action at this time.
0 commit comments