From eb5e2f4847d58f9afa3d6bd217526b0f1e048919 Mon Sep 17 00:00:00 2001 From: Brent Schroeter Date: Tue, 16 Sep 2025 23:17:21 -0700 Subject: [PATCH] derive Debug for AirtableRecord --- ferrtable/src/create_records.rs | 6 ++++-- ferrtable/src/list_records.rs | 9 +++++---- ferrtable/src/types.rs | 8 ++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ferrtable/src/create_records.rs b/ferrtable/src/create_records.rs index b625866..9cee067 100644 --- a/ferrtable/src/create_records.rs +++ b/ferrtable/src/create_records.rs @@ -1,3 +1,5 @@ +use std::fmt::Debug; + use derive_builder::Builder; use percent_encoding::{NON_ALPHANUMERIC, utf8_percent_encode}; use serde::de::DeserializeOwned; @@ -27,7 +29,7 @@ where #[derive(Clone, Deserialize)] pub struct CreateRecordsResponse where - T: Clone + Serialize, + T: Clone + Debug + Serialize, { /// Records successfully created in Airtable. pub records: Vec>, @@ -47,7 +49,7 @@ pub struct CreateRecordsDetails { impl CreateRecordsQuery where - T: Clone + DeserializeOwned + Serialize, + T: Clone + Debug + DeserializeOwned + Serialize, { /// Execute the API request. /// diff --git a/ferrtable/src/list_records.rs b/ferrtable/src/list_records.rs index adf29f9..dba66c4 100644 --- a/ferrtable/src/list_records.rs +++ b/ferrtable/src/list_records.rs @@ -1,4 +1,5 @@ use std::collections::VecDeque; +use std::fmt::Debug; use std::pin::Pin; use derive_builder::Builder; @@ -53,7 +54,7 @@ pub struct ListRecordsQuery { impl PaginatedQuery, ListRecordsResponse> for ListRecordsQuery where - T: Clone + DeserializeOwned, + T: Clone + Debug + DeserializeOwned, { fn get_offset(&self) -> Option { self.offset.clone() @@ -77,7 +78,7 @@ impl ListRecordsQuery { self, ) -> Pin, ExecutionError>>>> where - T: Clone + DeserializeOwned, + T: Clone + Debug + DeserializeOwned, { execute_paginated::, ListRecordsResponse>(self) } @@ -86,7 +87,7 @@ impl ListRecordsQuery { #[derive(Clone, Deserialize)] struct ListRecordsResponse where - T: Clone, + T: Clone + Debug, { offset: Option, records: VecDeque>, @@ -94,7 +95,7 @@ where impl PaginatedResponse> for ListRecordsResponse where - T: Clone + DeserializeOwned, + T: Clone + Debug + DeserializeOwned, { fn get_offset(&self) -> Option { self.offset.clone() diff --git a/ferrtable/src/types.rs b/ferrtable/src/types.rs index 6744825..849f7ad 100644 --- a/ferrtable/src/types.rs +++ b/ferrtable/src/types.rs @@ -1,11 +1,15 @@ +use std::fmt::Debug; + #[cfg(feature = "chrono")] use chrono::{DateTime, Utc}; use serde::Deserialize; -#[derive(Clone, Deserialize)] +// TODO: Write custom implementation of `Debug` trait that allows the `T: Debug` +// bound to be removed. +#[derive(Clone, Debug, Deserialize)] pub struct AirtableRecord where - T: Clone, + T: Clone + Debug, { /// Record ID. pub id: String,