diff --git a/examples/cdn/cache/Cargo.lock b/examples/cdn/cache/Cargo.lock index ab7f542..7ed5ca9 100644 --- a/examples/cdn/cache/Cargo.lock +++ b/examples/cdn/cache/Cargo.lock @@ -44,7 +44,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "fastedge" -version = "0.4.2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f99ccc6ecc029bcc8d2cf008f11647f8cea8eddccbab9e1489bfaac54bb0fd" dependencies = [ "bytes", "fastedge-derive", @@ -56,7 +58,9 @@ dependencies = [ [[package]] name = "fastedge-derive" -version = "0.4.2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4015884a15f36df9997409528e11be4e030708495fbfb4ccd662aaf6bd166fc" dependencies = [ "proc-macro2", "quote", diff --git a/examples/cdn/cache/Cargo.toml b/examples/cdn/cache/Cargo.toml index 880c44e..d4b96a2 100644 --- a/examples/cdn/cache/Cargo.toml +++ b/examples/cdn/cache/Cargo.toml @@ -10,6 +10,6 @@ crate-type = ["cdylib"] [dependencies] proxy-wasm = "0.2" -fastedge = { path = "../../..", features = ["proxywasm"] } +fastedge = { version = "0.4", features = ["proxywasm"] } querystring = "1.1" serde_json = "1" diff --git a/src/lib.rs b/src/lib.rs index 1487853..896c836 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -180,8 +180,8 @@ //! // Get a secret value //! match secret::get("API_KEY")? { //! Some(api_key) => { -//! // Use the API key -//! let key = String::from_utf8_lossy(&api_key); +//! // Use the API key (a String) +//! let _key: String = api_key; //! Response::builder() //! .status(StatusCode::OK) //! .body(Body::from("Secret retrieved")) @@ -222,7 +222,7 @@ //! let content = b"

Hello

".to_vec(); //! //! // Store it for 60 seconds -//! cache::set(key, content.clone(), Some(60_000))?; +//! cache::set(key, &content, Some(60_000))?; //! //! Response::builder() //! .status(StatusCode::OK) @@ -306,8 +306,8 @@ pub mod dictionary { /// // Get current secret value /// match secret::get("DATABASE_PASSWORD")? { /// Some(password) => { -/// let pwd = String::from_utf8_lossy(&password); -/// // Use the password to connect to database +/// // `password` is a String; use it to connect to the database +/// let _pwd: String = password; /// } /// None => { /// eprintln!("Secret not found"); @@ -446,10 +446,10 @@ pub mod key_value { /// use fastedge::cache; /// /// // Store with a 5-minute TTL -/// cache::set("session:abc123", b"user-data".to_vec(), Some(300_000))?; +/// cache::set("session:abc123", b"user-data", Some(300_000))?; /// /// // Store with no expiry -/// cache::set("config:flags", b"enabled".to_vec(), None)?; +/// cache::set("config:flags", b"enabled", None)?; /// # Ok::<(), Box>(()) /// ``` /// diff --git a/wit b/wit index 217ec2f..68c713f 160000 --- a/wit +++ b/wit @@ -1 +1 @@ -Subproject commit 217ec2fcf6f3dca5c96702a5afb705ef94aa655f +Subproject commit 68c713f2f8aaa14c8964978a6e98d54571281065