diff --git a/src/content/doc-sdk-rust/setup.mdx b/src/content/doc-sdk-rust/setup.mdx index a2cc20d66..4ba5617c2 100644 --- a/src/content/doc-sdk-rust/setup.mdx +++ b/src/content/doc-sdk-rust/setup.mdx @@ -83,7 +83,7 @@ async fn main() -> surrealdb::Result<()> { db.use_ns("test").use_db("test").await?; // Create a new person with a random id - let created: Vec = db + let created: Option = db .create("person") .content(Person { title: "Founder & CEO", @@ -227,7 +227,7 @@ Surreal::init() ### Example usage ```rust -static DB: Lazy> = Lazy::new(Surreal::init); +static DB: LazyLock> = LazyLock::new(Surreal::init); #[tokio::main] async fn main() -> surrealdb::Result<()> { @@ -822,7 +822,7 @@ db.create(resource).content(data) ### Example usage ```rust // Create a record with a random ID -let people: Vec = db.create("person").await?; +let person: Option = db.create("person").await?; // Create a record with a specific ID let record: Option = db .create(("person", "tobie")) diff --git a/src/content/doc-surrealdb/embedding/rust.mdx b/src/content/doc-surrealdb/embedding/rust.mdx index dbb3481ac..7d94acfd5 100644 --- a/src/content/doc-surrealdb/embedding/rust.mdx +++ b/src/content/doc-surrealdb/embedding/rust.mdx @@ -26,13 +26,7 @@ SurrealDB is designed to be run in many different ways, and environments. Due to ## Install the SDK -First, create a new project using `cargo new` and add the SurrealDB crate to your dependencies: - -```sh -cargo add surrealdb -``` - -You will then need to enable the appropriate features (for a full list see https://crates.io/crates/surrealdb): +First, create a new project using `cargo new` and add the SurrealDB crate to your dependencies, enabling the key-value store you need: ```sh # For an in memory database @@ -100,7 +94,7 @@ async fn main() -> surrealdb::Result<()> { db.use_ns("test").use_db("test").await?; // Create a new person with a random id - let created: Vec = db + let created: Option = db .create("person") .content(Person { title: "Founder & CEO", @@ -234,7 +228,7 @@ Surreal::init() ### Example usage ```rust -static DB: Lazy> = Lazy::new(Surreal::init); +static DB: LazyLock> = LazyLock::new(Surreal::init); #[tokio::main] async fn main() -> surrealdb::Result<()> { @@ -733,7 +727,7 @@ db.create(resource).content(data) ### Example usage ```rust // Create a record with a random ID -let people: Vec = db.create("person").await?; +let person: Option = db.create("person").await?; // Create a record with a specific ID let record: Record = db .create(("person", "tobie"))