Skip to content

Build error from Git #254

@clin1234

Description

@clin1234

While compiling, I got the following error:

error[E0593]: function is expected to take 1 argument, but it takes 0 arguments
   --> src\context\config\toml\mod.rs:231:40
    |
231 |         super::toml_from_env().or_else(toml_from_appda...
    |
 ------- ^^^^^^^^^^^^^^^^^ expected function that takes 1 argument
    |
 |
    |
 required by a bound introduced by this call
...
236 |     fn toml_from_appdata() -> Result<Config, Error> {
    |     ----------------------------------------------- takes 0 arguments
    |
note: required by a bound in `std::result::Result::<T, E>::or_else`
   --> /rustc/c987ad527540e8f1565f57c31204bde33f63df76\library\core\src\result.rs:1380:5

error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
   --> src\context\config\toml\mod.rs:237:42
    |
236 |     fn toml_from_appdata() -> Result<Config, Error...
    |     ----------------------------------------------- this function returns a `Result`
237 |         let app_data = dirs::config_dir()?;
    |
           ^ use `.ok_or(...)?` to provide an error compatible with `Result<Config, ...>`
    |
    = note: the full name for the type has been written to 'C:\Users\0BAC~1\AppData\Local\Temp\cargo-installIbuwrn\release\deps\erd.long-type-3764343166376834152.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<Config, ...>`
    = help: the following other types implement trait `FromResidual<R>`:
              <std::result::Result<T, F> as FromResidual<Yeet<E>>>
              <std::result::Result<T, F> as FromResidual<std::result::Result<Infallible, E>>>

error[E0277]: the `?` operator can only be used on `Result`s, not `Option`s, in a function that returns `Result`
   --> src\context\config\toml\mod.rs:244:34
    |
236 |     fn toml_from_appdata() -> Result<Config, Error...
    |     ----------------------------------------------- this function returns a `Result`
...
244 |             .map(File::with_name)?;
    |
   ^ use `.ok_or(...)?` to provide an error compatible with `Result<Config, ...>`
    |
    = note: the full name for the type has been written to 'C:\Users\0BAC~1\AppData\Local\Temp\cargo-installIbuwrn\release\deps\erd.long-type-3764343166376834152.txt'
    = note: consider using `--verbose` to print the full type name to the console
    = help: the trait `FromResidual<Option<Infallible>>` is not implemented for `Result<Config, ...>`
    = help: the following other types implement trait `FromResidual<R>`:
              <std::result::Result<T, F> as FromResidual<Yeet<E>>>
              <std::result::Result<T, F> as FromResidual<std::result::Result<Infallible, E>>>

Some errors have detailed explanations: E0277, E0593.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `erdtree` (bin "erd") due to 3 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions