Skip to content

Commit e2ff880

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Explicitly initialize fields of RunActionKnobs
Summary: - safer - also functional style is cleaner (`eager_dep_files` field is only initialized at construction rather than initialized to `false` and modified later) I was removing `new_style_scratch_path`, and with `Default` I accidentally missed the field. Reviewed By: IanChilds Differential Revision: D65611068 fbshipit-source-id: 4e8ab867f9994f266359147faaf10022592a058a
1 parent 5c2a36a commit e2ff880

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/buck2_server/src/ctx.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,22 @@ impl<'a> ServerCommandContext<'a> {
356356
.map(|opts| opts.skip_cache_write)
357357
.unwrap_or_default();
358358

359-
let mut run_action_knobs = RunActionKnobs {
359+
let eager_dep_files = if let Some(build_options) = self.build_options.as_ref() {
360+
build_options.eager_dep_files
361+
} else {
362+
false
363+
};
364+
365+
let run_action_knobs = RunActionKnobs {
360366
hash_all_commands: self.base_context.daemon.hash_all_commands,
361367
use_network_action_output_cache: self
362368
.base_context
363369
.daemon
364370
.use_network_action_output_cache,
365371
new_style_scratch_path: self.base_context.daemon.new_style_scratch_path,
366-
..Default::default()
372+
eager_dep_files,
367373
};
368374

369-
if let Some(build_options) = self.build_options.as_ref() {
370-
run_action_knobs.eager_dep_files = build_options.eager_dep_files;
371-
}
372-
373375
let concurrency = self
374376
.build_options
375377
.as_ref()

0 commit comments

Comments
 (0)