Skip to content

cannot find type NoneError in module std::option #37

Closed
@heeh

Description

@heeh

System:
Ubuntu 20.04 on wsl2
Issue:
The program does not compile any more. I guess this has something to do with nightly build.
rustc 1.54.0-nightly (ff2c947c0 2021-05-25)
log:

error[E0412]: cannot find type `NoneError` in module `std::option`
   --> src/err.rs:118:38
    |
118 | impl std::convert::From<std::option::NoneError> for Error {
    |                                      ^^^^^^^^^ not found in `std::option`

error[E0412]: cannot find type `NoneError` in module `std::option`
   --> src/err.rs:119:29
    |
119 |     fn from(_: std::option::NoneError) -> Self {
    |                             ^^^^^^^^^ not found in `std::option`

error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in an async function that returns `Result`
  --> src/plugins/leetcode.rs:75:29
   |
69 |       pub async fn get_category_problems(self, category: &str) -> Result<Response, Error> {
   |  _________________________________________________________________________________________-
70 | |         trace!("Requesting {} problems...", &category);
71 | |         let url = &self
72 | |             .conf
...  |
75 | |             .get("problems")?
   | |                             ^ use `.ok_or(...)?` to provide an error compatible with `Result<Response, err::Error>`
...  |
88 | |         .await
89 | |     }
   | |_____- this function returns a `Result`
   |
   = help: the trait `FromResidual<std::option::Option<Infallible>>` is not implemented for `Result<Response, err::Error>`
   = note: required by `from_residual`
(85 errors)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions