Skip to content

Commit 5e03d9f

Browse files
authored
fix: Rust doc fix (#1113)
## 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 #1112 . ## What changes are included in this PR? Added back original Anchor tags
1 parent cef87e4 commit 5e03d9f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

crates/examples/src/rest_catalog_namespace.rs

+6
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,24 @@ static REST_URI: &str = "http://localhost:8181";
3131
/// [quickstart documentation](https://iceberg.apache.org/spark-quickstart/).
3232
#[tokio::main]
3333
async fn main() {
34+
// ANCHOR: create_catalog
3435
// Create the REST iceberg catalog.
3536
let config = RestCatalogConfig::builder()
3637
.uri(REST_URI.to_string())
3738
.build();
3839
let catalog = RestCatalog::new(config);
40+
// ANCHOR_END: create_catalog
3941

42+
// ANCHOR: list_all_namespace
4043
// List all namespaces already in the catalog.
4144
let existing_namespaces = catalog.list_namespaces(None).await.unwrap();
4245
println!(
4346
"Namespaces alreading in the existing catalog: {:?}",
4447
existing_namespaces
4548
);
49+
// ANCHOR_END: list_all_namespace
4650

51+
// ANCHOR: create_namespace
4752
// Create a new namespace identifier.
4853
let namespace_ident =
4954
NamespaceIdent::from_vec(vec!["ns1".to_string(), "ns11".to_string()]).unwrap();
@@ -66,4 +71,5 @@ async fn main() {
6671

6772
let loaded_namespace = catalog.get_namespace(&namespace_ident).await.unwrap();
6873
println!("Namespace loaded!\n\nNamespace: {:#?}", loaded_namespace,);
74+
// ANCHOR_END: create_namespace
6975
}

crates/examples/src/rest_catalog_table.rs

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ async fn main() {
4040
.build();
4141
let catalog = RestCatalog::new(config);
4242

43+
// ANCHOR: create_table
4344
// Create the table identifier.
4445
let namespace_ident = NamespaceIdent::from_vec(vec![NAMESPACE.to_string()]).unwrap();
4546
let table_ident = TableIdent::new(namespace_ident.clone(), TABLE_NAME.to_string());
@@ -78,7 +79,9 @@ async fn main() {
7879
.await
7980
.unwrap();
8081
println!("Table {TABLE_NAME} created!");
82+
// ANCHOR_END: create_table
8183

84+
// ANCHOR: load_table
8285
// Ensure that the table is under the correct namespace.
8386
assert!(catalog
8487
.list_tables(&namespace_ident)
@@ -89,4 +92,5 @@ async fn main() {
8992
// Load the table back from the catalog. It should be identical to the created table.
9093
let loaded_table = catalog.load_table(&table_ident).await.unwrap();
9194
println!("Table {TABLE_NAME} loaded!\n\nTable: {:?}", loaded_table);
95+
// ANCHOR_END: load_table
9296
}

0 commit comments

Comments
 (0)