Skip to content

Commit 07d2953

Browse files
committed
implement display trait for Ident
1 parent d22cf4d commit 07d2953

File tree

1 file changed

+13
-1
lines changed
  • crates/iceberg/src/catalog

1 file changed

+13
-1
lines changed

crates/iceberg/src/catalog/mod.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//! Catalog API for Apache Iceberg
1919
2020
use std::collections::HashMap;
21-
use std::fmt::Debug;
21+
use std::fmt::{Debug, Display};
2222
use std::mem::take;
2323
use std::ops::Deref;
2424

@@ -192,6 +192,12 @@ impl Namespace {
192192
}
193193
}
194194

195+
impl Display for NamespaceIdent {
196+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
197+
write!(f, "{}", self.0.join("."))
198+
}
199+
}
200+
195201
/// TableIdent represents the identifier of a table in the catalog.
196202
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Hash)]
197203
pub struct TableIdent {
@@ -232,6 +238,12 @@ impl TableIdent {
232238
}
233239
}
234240

241+
impl Display for TableIdent {
242+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
243+
write!(f, "{}.{}", self.namespace, self.name)
244+
}
245+
}
246+
235247
/// TableCreation represents the creation of a table in the catalog.
236248
#[derive(Debug, TypedBuilder)]
237249
pub struct TableCreation {

0 commit comments

Comments
 (0)