Computing/Rust

From Cricalix.Net
Revision as of 17:02, 25 September 2023 by Cricalix (talk | contribs) (Created page with "Things I forget when doing new Rust installs, or other things I want to keep track of with Rust. # Install rust-analyzer via rustup. <code>rustup component add rust-analyzer</code> ==== Reqwest GET URIs ==== <syntaxhighlight lang="rust"> let mut req = client.get("https://www.google.com").build().unwrap(); let query: String = form_urlencoded::Serializer::new(String::new())    .append_key_only("foo")    .finish(); req.url_mut().set_query(Some(&query)); </syntaxhighl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Things I forget when doing new Rust installs, or other things I want to keep track of with Rust.

  1. Install rust-analyzer via rustup. rustup component add rust-analyzer

Reqwest GET URIs

let mut req = client.get("https://www.google.com").build().unwrap();

let query: String = form_urlencoded::Serializer::new(String::new())
   .append_key_only("foo")
   .finish();
req.url_mut().set_query(Some(&query));

Clap for CLI handling

cargo add clap -F derive,env