Skip to content

Commit e54e354

Browse files
committed
Fix Input.ad_slot_hostname & derive(Serialize) for ChannelListQuery
1 parent 33e0357 commit e54e354

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

primitives/src/sentry.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,17 @@ impl fmt::Display for ChannelReport {
217217

218218
pub mod channel_list {
219219
use crate::ValidatorId;
220-
use chrono::serde::ts_seconds::deserialize as ts_seconds;
221-
use chrono::{DateTime, Utc};
220+
use chrono::{DateTime, Utc, serde::ts_seconds};
222221
use serde::Deserialize;
223222

224-
#[derive(Debug, Deserialize)]
223+
#[derive(Debug, Serialize, Deserialize)]
225224
pub struct ChannelListQuery {
226225
#[serde(default = "default_page")]
227226
pub page: u64,
228227
/// filters the list on `valid_until >= valid_until_ge`
229228
/// It should be the same timestamp format as the `Channel.valid_until`: **seconds**
230229
#[serde(
231-
deserialize_with = "ts_seconds",
230+
with = "ts_seconds",
232231
default = "Utc::now",
233232
rename = "validUntil"
234233
)]

primitives/src/targeting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl Input {
8383
"adSlot.hostname" => self
8484
.ad_slot
8585
.as_ref()
86-
.map(|ad_slot| Value::String(ad_slot.hostname.clone().unwrap_or_default()))
86+
.map(|ad_slot| Value::String(ad_slot.hostname.clone()))
8787
.ok_or(Error::UnknownVariable),
8888
"adSlot.alexaRank" => {
8989
// @TODO: Decide how to handle Alexa rank values
@@ -137,7 +137,7 @@ pub struct Global {
137137
#[cfg_attr(test, derive(Default))]
138138
pub struct AdSlot {
139139
pub categories: Vec<String>,
140-
pub hostname: Option<String>,
140+
pub hostname: String,
141141
pub alexa_rank: Option<f64>,
142142
}
143143

0 commit comments

Comments
 (0)