Skip to content

Commit

Permalink
revise: removes multiple #[builder(into)] declarations
Browse files Browse the repository at this point in the history
The author of `bon` helpfully pointed out
[here](4ad7e01#r152203674)
that we shouldn't be using `[builder(into)]` for numeric types because
it ambiguates what type the numbers should resolve to.
  • Loading branch information
claymcleod committed Feb 8, 2025
1 parent 27184a2 commit 254601c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
5 changes: 4 additions & 1 deletion crankshaft-config/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Use `thiserror` for custom error types ([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Use `thiserror` for custom error types
([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Removes `#[builder(into)]` for numerical types
([#10](https://github.com/stjude-rust-labs/crankshaft/pull/10)).
1 change: 0 additions & 1 deletion crankshaft-config/src/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub struct Config {
kind: Kind,

/// The maximum number of concurrent tasks that can run.
#[builder(into)]
max_tasks: usize,

/// The execution defaults.
Expand Down
1 change: 0 additions & 1 deletion crankshaft-config/src/backend/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub struct Config {
monitor: String,

/// The frequency in seconds that the job status will be queried.
#[builder(into)]
monitor_frequency: Option<u64>,

/// The script used to kill a job.
Expand Down
1 change: 0 additions & 1 deletion crankshaft-config/src/backend/generic/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pub struct Config {
shell: Option<Shell>,

/// The maximum number of attempts to try a command execution.
#[builder(into)]
max_attempts: Option<u32>,
}

Expand Down
1 change: 0 additions & 1 deletion crankshaft-config/src/backend/generic/driver/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ pub struct Config {
username: Option<String>,

/// A port.
#[builder(into)]
port: usize,
}

Expand Down
9 changes: 6 additions & 3 deletions crankshaft-docker/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Use `thiserror` for custom error types ([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Separate `program` from `args` in container builder ([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Replaced `attached` with separate stdout and stderr attach flags ([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Use `thiserror` for custom error types
([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Separate `program` from `args` in container builder
([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
* Replaced `attached` with separate stdout and stderr attach flags
([#8](https://github.com/stjude-rust-labs/crankshaft/pull/8)).
2 changes: 2 additions & 0 deletions crankshaft-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
`Input::builder`.
* Better handling for URL contents in inputs.
* Swaps out most of the bespoke builders for `bon`.
* Removes `#[builder(into)]` for numerical types
([#10](https://github.com/stjude-rust-labs/crankshaft/pull/10)).
3 changes: 0 additions & 3 deletions crankshaft-engine/src/task/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ use crankshaft_config::backend::Defaults;
#[builder(builder_type = Builder)]
pub struct Resources {
/// The number of CPU cores requested.
#[builder(into)]
cpu: Option<usize>,

/// Whether or not the task may use preemptible resources.
#[builder(into)]
preemptible: Option<bool>,

/// The requested random access memory size in gigabytes.
#[builder(into)]
ram: Option<f64>,

/// The requested disk size in gigabytes.
#[builder(into)]
disk: Option<f64>,

/// The associated compute zones.
Expand Down

0 comments on commit 254601c

Please sign in to comment.