Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revise: removes ordered_float from the f64 fields #6

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changes out the `anyhow` error type for `miette`
([#5](https://github.com/stjude-rust-labs/tes/pull/5)).
- Removes the `Eq` and `Ord` trait from types containing a `f64` via removal of
`ordered_float` ([#6](https://github.com/stjude-rust-labs/tes/pull/6)).


## 0.3.0 - 01-30-2025
Expand Down
14 changes: 0 additions & 14 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ rust-version = "1.80.0"
anyhow = { version = "1.0.95", optional = true }
chrono = { version = "0.4.38", features = ["serde"] }
miette = { version = "7.5.0", optional = true }
ordered-float = { version = "4.2.2", features = ["serde"] }
reqwest = { version = "0.12.7", features = ["json"] }
reqwest-middleware = "0.3.3"
reqwest-retry = "0.6.1"
Expand Down
4 changes: 2 additions & 2 deletions src/v1/types/responses/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ pub struct MinimalTask {
}

/// A generalized response for getting tasks with the `view` parameter.
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(untagged))]
#[cfg_attr(feature = "ord", derive(Ord, PartialOrd))]
#[cfg_attr(feature = "ord", derive(PartialOrd))]
pub enum Response {
/// A response for when `?view=MINIMAL` in a task endpoint.
Minimal(MinimalTask),
Expand Down
13 changes: 6 additions & 7 deletions src/v1/types/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::collections::HashMap;

use chrono::DateTime;
use chrono::Utc;
use ordered_float::OrderedFloat;

pub mod executor;
pub mod file;
Expand Down Expand Up @@ -115,9 +114,9 @@ pub struct Output {
}

/// Requested resources for a TES task.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "ord", derive(Ord, PartialOrd))]
#[cfg_attr(feature = "ord", derive(PartialOrd))]
pub struct Resources {
/// The number of CPU cores.
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
Expand All @@ -129,11 +128,11 @@ pub struct Resources {

/// The amount of RAM (in gigabytes).
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub ram_gb: Option<OrderedFloat<f64>>,
pub ram_gb: Option<f64>,

/// The amount of disk space (in gigabytes).
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
pub disk_gb: Option<OrderedFloat<f64>>,
pub disk_gb: Option<f64>,

/// The zones.
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
Expand Down Expand Up @@ -180,9 +179,9 @@ pub struct TaskLog {
}

/// A task.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
#[derive(Clone, Debug, Default, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "ord", derive(Ord, PartialOrd))]
#[cfg_attr(feature = "ord", derive(PartialOrd))]
pub struct Task {
/// The ID.
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
Expand Down