Skip to content

Calling Option::unwrap() on a None value recorded in Rocket app #11509

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

Closed
whatevernot opened this issue Feb 20, 2022 · 1 comment
Closed

Calling Option::unwrap() on a None value recorded in Rocket app #11509

whatevernot opened this issue Feb 20, 2022 · 1 comment

Comments

@whatevernot
Copy link

Hello - I have a simple Rocket app which is displaying errors on my endpoint declarations. Example:

#[get("/foo/<d>")]
fn get_foo(d: &RawStr) -> String {
    format!("get_foo:::: {}", d)
}

This results in an error (and ugly red text) "called Option::unwrap() on a None valuerust-analyzer[macro-error]".

I am stumped.

rust-analyzer version:

  • 0.2.940

rustc version:

  • rustc 1.61.0-nightly (3b348d932 2022-02-19)

rustup version:

  • stable-x86_64-unknown-linux-gnu unchanged - rustc 1.58.1 (db9d1b20b 2022-01-20)
  • nightly-x86_64-unknown-linux-gnu unchanged - rustc 1.61.0-nightly (3b348d932 2022-02-19)

I've tried various versions of rust-analyzer and they all seem to exhibit this error.

Any help is appreciated - the code works fine by rust-analyzer flags all my endpoints as errors.

Thanks a bunch.

@Veykril
Copy link
Member

Veykril commented Feb 20, 2022

Duplicate of #10570

@Veykril Veykril marked this as a duplicate of #10570 Feb 20, 2022
@Veykril Veykril closed this as completed Feb 20, 2022
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

2 participants