Skip to content

Commit

Permalink
replace derivative with educe crate
Browse files Browse the repository at this point in the history
  • Loading branch information
xeniape committed Dec 18, 2024
1 parent 48c0a11 commit 1737070
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 77 deletions.
39 changes: 14 additions & 25 deletions Cargo.lock

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

67 changes: 21 additions & 46 deletions Cargo.nix

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ base64 = "0.22"
built = { version = "0.7", features = ["chrono", "git2"] }
byteorder = "1.5"
clap = "4.5"
derivative = "2.2"
educe = { version = "0.6.0", default-features = false, features = ["Default"] }
flate2 = "1.0"
fnv = "1.0"
futures = { version = "0.3" }
Expand Down
2 changes: 1 addition & 1 deletion rust/crd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository.workspace = true
publish = false

[dependencies]
derivative.workspace = true
educe.workspace = true
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
Expand Down
8 changes: 4 additions & 4 deletions rust/crd/src/user_info_fetcher.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::BTreeMap;

use derivative::Derivative;
use educe::Educe;
use serde::{Deserialize, Serialize};
use stackable_operator::{
commons::{networking::HostName, tls_verification::TlsClientDetails},
Expand Down Expand Up @@ -115,12 +115,12 @@ pub struct ActiveDirectoryBackend {
pub custom_attribute_mappings: BTreeMap<String, String>,
}

#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Derivative)]
#[derivative(Default)]
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize, Educe)]
#[educe(Default)]
#[serde(rename_all = "camelCase")]
pub struct Cache {
/// How long metadata about each user should be cached for.
#[derivative(Default(value = "Cache::default_entry_time_to_live()"))]
#[educe(Default = Cache::default_entry_time_to_live())]
#[serde(default = "Cache::default_entry_time_to_live")]
pub entry_time_to_live: Duration,
}
Expand Down

0 comments on commit 1737070

Please sign in to comment.