Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Example (Check a webpage for broken links) #723

Open
Arteiii opened this issue Jan 9, 2025 · 0 comments
Open

Broken Example (Check a webpage for broken links) #723

Arteiii opened this issue Jan 9, 2025 · 0 comments

Comments

@Arteiii
Copy link
Contributor

Arteiii commented Jan 9, 2025

https://rust-lang-nursery.github.io/rust-cookbook/web/scraping.html#check-a-webpage-for-broken-links

   Compiling playground v0.0.1 (/playground)
error[E0670]: `async fn` is not permitted in Rust 2015
  --> src/main.rs:31:1
   |
31 | async fn get_base_url(url: &Url, doc: &Document) -> Result<Url, BrokenError> {
   | ^^^^^ to use `async fn`, switch to Rust 2018 or later
   |
   = help: set `edition = "2021"` in `Cargo.toml`
   = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error[E0670]: `async fn` is not permitted in Rust 2015
  --> src/main.rs:38:1
   |
38 | async fn check_link(url: &Url) -> Result<bool, BrokenError> {
   | ^^^^^ to use `async fn`, switch to Rust 2018 or later
   |
   = help: set `edition = "2021"` in `Cargo.toml`
   = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error[E0670]: `async fn` is not permitted in Rust 2015
  --> src/main.rs:43:5
   |
43 | pub async fn check(site: &str) -> Result<CategorizedUrls, BrokenError> {
   |     ^^^^^ to use `async fn`, switch to Rust 2018 or later
   |
   = help: set `edition = "2021"` in `Cargo.toml`
   = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error: `async move` blocks are only allowed in Rust 2018 or later
  --> src/main.rs:59:33
   |
59 |         tasks.push(tokio::spawn(async move {
   |                                 ^^^^^^^^^^

error: expected item, found `[`
  --> src/main.rs:80:1
   |
80 | [tokio::main]
   | ^ expected item
   |
   = note: for a full list of items that can appear in modules, see <https://doc.rust-lang.org/reference/items.html>

For more information about this error, try `rustc --explain E0670`.
error: could not compile `playground` (bin "playground") due to 5 previous errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant