eickler commented on code in PR #1970:
URL: https://github.com/apache/iceberg-rust/pull/1970#discussion_r2651616711


##########
crates/iceberg/src/catalog/memory/catalog.rs:
##########
@@ -163,7 +163,11 @@ impl Catalog for MemoryCatalog {
                 let namespaces = root_namespace_state
                     .list_namespaces_under(parent_namespace_ident)?
                     .into_iter()
-                    .map(|name| NamespaceIdent::new(name.to_string()))
+                    .map(|name| {
+                        let mut names = 
parent_namespace_ident.iter().cloned().collect::<Vec<_>>();
+                        names.push(name.to_string());
+                        NamespaceIdent::from_vec(names).unwrap()

Review Comment:
   Ah sorry, I have only started with Rust. I thought unwrap() would be 
reasonable here since `names` is guaranteed to have at least one element and 
the result can only be Err if `names` has no elements.
   
   I could terminate on the first error and return the error. Is that better?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to