MCPcopy Index your code
hub / github.com/bedroombuilds/python2rust / main

Function main

1e_http_client/rust/http_client/src/main.rs:5–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3mod person;
4
5fn main() -> Result<(), ureq::Error> {
6 let data: person::Data = ureq::get(person::URL)
7 .set("User-Agent", "Mozilla/5.0 (Macintosh; M1 Mac OS X 11_9_3)")
8 .call()?
9 .into_json()?;
10 println!("{}", data);
11
12 let now = Instant::now();
13 for _ in 0..50 {
14 let body: serde_json::Value = ureq::get(person::URL)
15 .set("User-Agent", "Mozilla/5.0 (Macintosh; M1 Mac OS X 11_9")
16 .call()?
17 .into_json()?;
18 println!("{}", person::summary(body));
19 }
20 println!("{:.2}secs runtime", now.elapsed().as_secs_f64());
21 Ok(())
22}

Callers

nothing calls this directly

Calls 1

getFunction · 0.85

Tested by

no test coverage detected