@@ -116,7 +116,7 @@ impl FileSummary {
116116}
117117
118118/// The different types of output files that tectonic knows how to produce.
119- #[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
119+ #[ derive( Clone , Copy , Debug , Default , Eq , PartialEq ) ]
120120pub enum OutputFormat {
121121 /// A '.aux' file.
122122 Aux ,
@@ -125,6 +125,7 @@ pub enum OutputFormat {
125125 /// An extended DVI file.
126126 Xdv ,
127127 /// A '.pdf' file.
128+ #[ default]
128129 Pdf ,
129130 /// A '.fmt' file, for initializing the TeX engine.
130131 Format ,
@@ -145,30 +146,19 @@ impl FromStr for OutputFormat {
145146 }
146147}
147148
148- impl Default for OutputFormat {
149- fn default ( ) -> OutputFormat {
150- OutputFormat :: Pdf
151- }
152- }
153-
154149/// The different types of "passes" that [`ProcessingSession`] knows how to run. See
155150/// [`ProcessingSession::run`] for more details.
156- #[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
151+ #[ derive( Clone , Copy , Debug , Default , Eq , PartialEq ) ]
157152pub enum PassSetting {
158153 /// The default pass, which repeatedly runs TeX and BibTeX until it doesn't need to any more.
154+ #[ default]
159155 Default ,
160156 /// Just run the TeX engine once.
161157 Tex ,
162158 /// Like the default pass, but runs BibTeX once first, before doing anything else.
163159 BibtexFirst ,
164160}
165161
166- impl Default for PassSetting {
167- fn default ( ) -> PassSetting {
168- PassSetting :: Default
169- }
170- }
171-
172162impl FromStr for PassSetting {
173163 type Err = & ' static str ;
174164
@@ -183,9 +173,10 @@ impl FromStr for PassSetting {
183173}
184174
185175/// Different places from which the "primary input" might originate.
186- #[ derive( Clone , Debug , Eq , PartialEq ) ]
176+ #[ derive( Clone , Debug , Default , Eq , PartialEq ) ]
187177enum PrimaryInputMode {
188178 /// This process's standard input.
179+ #[ default]
189180 Stdin ,
190181
191182 /// A path on the filesystem.
@@ -195,18 +186,13 @@ enum PrimaryInputMode {
195186 Buffer ( Vec < u8 > ) ,
196187}
197188
198- impl Default for PrimaryInputMode {
199- fn default ( ) -> PrimaryInputMode {
200- PrimaryInputMode :: Stdin
201- }
202- }
203-
204189/// Different places where the output files might land.
205- #[ derive( Clone , Debug , Eq , PartialEq ) ]
190+ #[ derive( Clone , Debug , Default , Eq , PartialEq ) ]
206191enum OutputDestination {
207192 /// The "sensible" default. Files will land in the same directory as the
208193 /// input file, or the current working directory if the input is something
209194 /// without a path (such as standard input).
195+ #[ default]
210196 Default ,
211197
212198 /// Files should land in this particular directory.
@@ -217,12 +203,6 @@ enum OutputDestination {
217203 Nowhere ,
218204}
219205
220- impl Default for OutputDestination {
221- fn default ( ) -> OutputDestination {
222- OutputDestination :: Default
223- }
224- }
225-
226206/// The subset of the driver state that is captured when running a C/C++ engine.
227207///
228208/// The main purpose of this type is to implement the [`DriverHooks`] trait,
@@ -778,11 +758,12 @@ impl DriverHooks for BridgeState {
778758}
779759
780760/// Possible modes for handling shell-escape functionality
781- #[ derive( Clone , Debug , Eq , PartialEq ) ]
761+ #[ derive( Clone , Debug , Default , Eq , PartialEq ) ]
782762enum ShellEscapeMode {
783763 /// "Default" mode: shell-escape is disabled, unless it's been turned on in
784764 /// the unstable options, in which case it will be allowed through a
785765 /// temporary directory.
766+ #[ default]
786767 Defaulted ,
787768
788769 /// Shell-escape is disabled, overriding any unstable-option setting.
@@ -798,12 +779,6 @@ enum ShellEscapeMode {
798779 ExternallyManagedDir ( PathBuf ) ,
799780}
800781
801- impl Default for ShellEscapeMode {
802- fn default ( ) -> Self {
803- ShellEscapeMode :: Defaulted
804- }
805- }
806-
807782/// A custom extra pass that invokes an external tool.
808783///
809784/// This is bad for reproducibility but comes in handy.
0 commit comments