HKGx / xkcd-ascii

Converts xkcd comics to ascii art. GCI task.
1 stars 0 forks source link

Can't compile #1

Open enderandrew opened 6 months ago

enderandrew commented 6 months ago
error[E0599]: no method named timeout_connect found for struct ureq::Request in the current scope --> src/xkcd.rs:52:10 51 let resp = ureq::get(comic.img.as_str()) ____- 52 .timeout_connect(8_000) -^^^^^^^^^^^^^^^ method not found in Request _____
error[E0599]: no method named timeout_connect found for struct ureq::Request in the current scope --> src/xkcd.rs:77:10 76 let resp = ureq::get("https://c.xkcd.com/api-0/jsonp/comic") ____- 77 .timeout_connect(4_000) -^^^^^^^^^^^^^^^ method not found in Request _____
error[E0599]: no method named timeout_connect found for struct ureq::Request in the current scope --> src/xkcd.rs:93:10 92 let resp = ureq::get(format!("https://c.xkcd.com/api-0/jsonp/comic/{}", id).as_str()) ____- 93 .timeout_connect(4_000) -^^^^^^^^^^^^^^^ method not found in Request _____
warning: unused import: std::io::Read --> src/xkcd.rs:10:5 10 use std::io::Read; ^^^^^^^^^^^^^

= note: #[warn(unused_imports)] on by default

For more information about this error, try rustc --explain E0599. warning: xkcd-ascii (bin "xkcd-ascii") generated 1 warning error: could not compile xkcd-ascii (bin "xkcd-ascii") due to 3 previous errors; 1 warning emitted

HKGx commented 6 months ago

@enderandrew Very possible that it doesn't compile as it was created in 2019 and I didn't lock the dependencies properly. I have no time to maintain it, but you can try changing the cargo.toml file like:

-ureq = { version = "*", features = ["json"] }
+ureq = { version = "1.5.5", features = ["json"] }

or some older version