diff --git a/eppo_core/src/configuration_store.rs b/eppo_core/src/configuration_store.rs index 260acd04..3272b55f 100644 --- a/eppo_core/src/configuration_store.rs +++ b/eppo_core/src/configuration_store.rs @@ -67,7 +67,7 @@ mod tests { let _ = std::thread::spawn(move || { store.set_configuration(Arc::new(Configuration::from_server_response( UniversalFlagConfig { - wire_json: Vec::from(b"test-bytes"), + wire_json: b"test-bytes".to_vec(), compiled: CompiledFlagsConfig { created_at: Utc::now(), environment: Environment { diff --git a/eppo_core/src/context_attributes.rs b/eppo_core/src/context_attributes.rs index f7005675..53ef2313 100644 --- a/eppo_core/src/context_attributes.rs +++ b/eppo_core/src/context_attributes.rs @@ -50,8 +50,10 @@ where // We can go a step further and remove `AttributeValue::Boolean` altogether // (from `eppo_core`), forcing it to be converted to a string before any // evaluation. - acc.categorical - .insert(key.to_owned(), value.to_string().into()); + acc.categorical.insert( + key.to_owned(), + Str::from_static_str(if value { "true" } else { "false" }), + ); } AttributeValue::Null => { // Nulls are missing values and are ignored. diff --git a/eppo_core/src/lib.rs b/eppo_core/src/lib.rs index 8e72352b..fe1d770a 100644 --- a/eppo_core/src/lib.rs +++ b/eppo_core/src/lib.rs @@ -67,9 +67,9 @@ mod error; mod sdk_metadata; mod str; +pub use crate::str::Str; pub use attributes::{AttributeValue, Attributes}; pub use configuration::Configuration; pub use context_attributes::ContextAttributes; pub use error::{Error, EvaluationError, Result}; pub use sdk_metadata::SdkMetadata; -pub use str::Str;