Skip to content

Commit f59f590

Browse files
authored
feat: implement display trait for Ident (#1049)
## Which issue does this PR close? <!-- We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123. --> - Closes #. ## What changes are included in this PR? <!-- Provide a summary of the modifications in this PR. List the main changes such as new features, bug fixes, refactoring, or any other updates. --> ## Are these changes tested? <!-- Specify what test covers (unit test, integration test, etc.). If tests are not included in your PR, please explain why (for example, are they covered by existing tests)? --> Co-authored-by: ZENOTME <st810918843@gmail.com>
1 parent 2f0d4c7 commit f59f590

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)