From 254601c3c0e1ac09efbb4df2d97bd2ddae20da84 Mon Sep 17 00:00:00 2001 From: Clay McLeod Date: Fri, 7 Feb 2025 20:47:39 -0600 Subject: [PATCH] revise: removes multiple `#[builder(into)]` declarations The author of `bon` helpfully pointed out [here](https://github.com/stjude-rust-labs/crankshaft/commit/4ad7e01876857e7a8580819ce477bdf6641898af#r152203674) that we shouldn't be using `[builder(into)]` for numeric types because it ambiguates what type the numbers should resolve to. --- crankshaft-config/CHANGELOG.md | 5 ++++- crankshaft-config/src/backend.rs | 1 - crankshaft-config/src/backend/generic.rs | 1 - crankshaft-config/src/backend/generic/driver.rs | 1 - crankshaft-config/src/backend/generic/driver/ssh.rs | 1 - crankshaft-docker/CHANGELOG.md | 9 ++++++--- crankshaft-engine/CHANGELOG.md | 2 ++ crankshaft-engine/src/task/resources.rs | 3 --- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/crankshaft-config/CHANGELOG.md b/crankshaft-config/CHANGELOG.md index eddbb01..9c7b2d2 100644 --- a/crankshaft-config/CHANGELOG.md +++ b/crankshaft-config/CHANGELOG.md @@ -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)). diff --git a/crankshaft-config/src/backend.rs b/crankshaft-config/src/backend.rs index 6abdd4e..a00e987 100644 --- a/crankshaft-config/src/backend.rs +++ b/crankshaft-config/src/backend.rs @@ -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. diff --git a/crankshaft-config/src/backend/generic.rs b/crankshaft-config/src/backend/generic.rs index b4f3836..dd3cd95 100644 --- a/crankshaft-config/src/backend/generic.rs +++ b/crankshaft-config/src/backend/generic.rs @@ -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, /// The script used to kill a job. diff --git a/crankshaft-config/src/backend/generic/driver.rs b/crankshaft-config/src/backend/generic/driver.rs index e08ca7d..b95cf68 100644 --- a/crankshaft-config/src/backend/generic/driver.rs +++ b/crankshaft-config/src/backend/generic/driver.rs @@ -30,7 +30,6 @@ pub struct Config { shell: Option, /// The maximum number of attempts to try a command execution. - #[builder(into)] max_attempts: Option, } diff --git a/crankshaft-config/src/backend/generic/driver/ssh.rs b/crankshaft-config/src/backend/generic/driver/ssh.rs index 641cd4b..a5da764 100644 --- a/crankshaft-config/src/backend/generic/driver/ssh.rs +++ b/crankshaft-config/src/backend/generic/driver/ssh.rs @@ -14,7 +14,6 @@ pub struct Config { username: Option, /// A port. - #[builder(into)] port: usize, } diff --git a/crankshaft-docker/CHANGELOG.md b/crankshaft-docker/CHANGELOG.md index 9463105..cd9838d 100644 --- a/crankshaft-docker/CHANGELOG.md +++ b/crankshaft-docker/CHANGELOG.md @@ -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)). diff --git a/crankshaft-engine/CHANGELOG.md b/crankshaft-engine/CHANGELOG.md index ab4ac8b..078a785 100644 --- a/crankshaft-engine/CHANGELOG.md +++ b/crankshaft-engine/CHANGELOG.md @@ -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)). diff --git a/crankshaft-engine/src/task/resources.rs b/crankshaft-engine/src/task/resources.rs index 62a7897..6bac343 100644 --- a/crankshaft-engine/src/task/resources.rs +++ b/crankshaft-engine/src/task/resources.rs @@ -12,7 +12,6 @@ use crankshaft_config::backend::Defaults; #[builder(builder_type = Builder)] pub struct Resources { /// The number of CPU cores requested. - #[builder(into)] cpu: Option, /// Whether or not the task may use preemptible resources. @@ -20,11 +19,9 @@ pub struct Resources { preemptible: Option, /// The requested random access memory size in gigabytes. - #[builder(into)] ram: Option, /// The requested disk size in gigabytes. - #[builder(into)] disk: Option, /// The associated compute zones.