@@ -612,6 +612,7 @@ struct WorkspacePackageSettings {
612612 description : Option < String > ,
613613 homepage : Option < String > ,
614614 version : Option < String > ,
615+ license : Option < String > ,
615616}
616617
617618#[ derive( Clone , Debug , Deserialize ) ]
@@ -635,7 +636,7 @@ pub struct CargoPackageSettings {
635636 /// the package's authors.
636637 pub authors : Option < MaybeWorkspace < Vec < String > > > ,
637638 /// the package's license.
638- pub license : Option < String > ,
639+ pub license : Option < MaybeWorkspace < String > > ,
639640 /// the default binary to run.
640641 pub default_run : Option < String > ,
641642}
@@ -930,7 +931,16 @@ impl RustAppSettings {
930931 } )
931932 . unwrap ( )
932933 } ) ,
933- license : cargo_package_settings. license . clone ( ) ,
934+ license : cargo_package_settings. license . clone ( ) . map ( |license| {
935+ license
936+ . resolve ( "license" , || {
937+ ws_package_settings
938+ . as_ref ( )
939+ . and_then ( |v| v. license . clone ( ) )
940+ . ok_or_else ( || anyhow:: anyhow!( "Couldn't inherit value for `license` from workspace" ) )
941+ } )
942+ . unwrap ( )
943+ } ) ,
934944 default_run : cargo_package_settings. default_run . clone ( ) ,
935945 } ;
936946
0 commit comments