Skip to content

Commit

Permalink
Support @fromfile option values in the Rust options parser. (#20634)
Browse files Browse the repository at this point in the history
As part of this, streamlines away some previous function pointer
clunkiness via a new `Parseable` trait that implements parsing
of scalars and list of scalars for the scalar types bool/i64/f64/String.

While messing with this code: this change also implements the 
"source" field for list- and dict-valued option values.
Previously this was only provided for scalar-valued options. However
the highest-priority source is still a valid and useful concept even
for compound values that might be composed across multiple sources.
  • Loading branch information
benjyw authored Mar 5, 2024
1 parent 88dab26 commit af1b5c7
Show file tree
Hide file tree
Showing 12 changed files with 1,099 additions and 219 deletions.
114 changes: 79 additions & 35 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ serde = "1.0.160"
serde_derive = "1.0.98"
serde_json = "1.0"
serde_test = "1.0"
serde_yaml = "0.9"
sha2 = "0.10"
shell-quote = "0.3.0"
shellexpand = "2.1"
Expand Down
3 changes: 3 additions & 0 deletions src/rust/engine/options/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ shellexpand = { workspace = true }
toml = { workspace = true }
regex = { workspace = true }
whoami = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_yaml = { workspace = true }

[dev-dependencies]
tempfile = { workspace = true }
Expand Down
Loading

0 comments on commit af1b5c7

Please sign in to comment.