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

Build error from Git #254

Open
clin1234 opened this issue May 2, 2024 · 0 comments
Open

Build error from Git #254

clin1234 opened this issue May 2, 2024 · 0 comments

Comments

@clin1234
Copy link

clin1234 commented May 2, 2024

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
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