diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a0fe3f2..c085c1f6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ Also, the WASM example compilation should be checked: ```bash rustup target add wasm32-unknown-unknown -cargo check --example web_app --target wasm32-unknown-unknown --features=sync +cargo check -p web_app --target wasm32-unknown-unknown ``` Each PR should pass the tests to be accepted. diff --git a/examples/web_app/README.md b/examples/web_app/README.md index 239bdd8e..ae28fb90 100644 --- a/examples/web_app/README.md +++ b/examples/web_app/README.md @@ -11,7 +11,7 @@ The Rust source files are compiled into WebAssembly and so can be readable by th If you only want to check if this example compiles, you can run: ```console -cargo build --example web_app +cargo build ``` ## Building @@ -23,7 +23,7 @@ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh ``` ```console -wasm-pack build examples/web_app/ --target=web --no-typescript +wasm-pack build . --target=web --no-typescript ``` The compiled files will be stored in the `examples/web_app/pkg` folder. diff --git a/examples/web_app/src/lib.rs b/examples/web_app/src/lib.rs index 921a1f7a..1b965035 100644 --- a/examples/web_app/src/lib.rs +++ b/examples/web_app/src/lib.rs @@ -15,10 +15,7 @@ mod document; use crate::document::{display, Crate}; lazy_static! { - static ref CLIENT: Client = Client::new( - "https://finding-demos.meilisearch.com", - "2b902cce4f868214987a9f3c7af51a69fa660d74a785bed258178b96e3480bb3", - ); + static ref CLIENT: Client = Client::new("http://localhost:7700", "masterKey",); } struct Model { diff --git a/src/request.rs b/src/request.rs index e3028a6b..5ac7a9b0 100644 --- a/src/request.rs +++ b/src/request.rs @@ -109,13 +109,16 @@ pub(crate) async fn request { let query = yaup::to_string(query)?; - mut_url = if query.is_empty() { - mut_url.to_string() - } else { - format!("{}?{}", mut_url, query) + if !query.is_empty() { + mut_url = format!("{}?{}", mut_url, query); }; request.method("GET");