File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pub struct App {
5353 pub globals : Globals ,
5454 /// The subcommand to run, if any.
5555 #[ command( subcommand) ]
56- pub command : Option < Command > ,
56+ pub command : Command ,
5757}
5858
5959/// Represents sources of errors that can occur during application runs.
@@ -155,19 +155,17 @@ impl App {
155155 discover ( ) . map_err ( Error :: discover) ?
156156 } ;
157157
158- if let Some ( command) = self . command {
159- match command {
160- Command :: Build ( build) => {
161- build. run ( workspace) . map_err ( Error :: build) ?;
162- }
163- Command :: Preview ( preview) => {
164- preview. run ( workspace) . map_err ( Error :: preview) ?;
165- }
166- Command :: Create ( create) => {
167- let directory = workspace. config . paths . directory ;
168-
169- create. run ( directory) . map_err ( Error :: create) ?;
170- }
158+ match self . command {
159+ Command :: Build ( build) => {
160+ build. run ( workspace) . map_err ( Error :: build) ?;
161+ }
162+ Command :: Preview ( preview) => {
163+ preview. run ( workspace) . map_err ( Error :: preview) ?;
164+ }
165+ Command :: Create ( create) => {
166+ let directory = workspace. config . paths . directory ;
167+
168+ create. run ( directory) . map_err ( Error :: create) ?;
171169 }
172170 } ;
173171
You can’t perform that action at this time.
0 commit comments