wtftw icon indicating copy to clipboard operation
wtftw copied to clipboard

Compiling config results in error E0271

Open lvx-tenebris opened this issue 4 years ago • 8 comments

"error[E0271]: type mismatch resolving for<'r> <for<'s> fn(wtftw::window_manager::WindowManager, Rc<(dyn wtftw::window_system::WindowSystem + 'static)>, &'s GeneralConfig) -> std::result::Result<wtftw::window_manager::WindowManager, anyhow::Error> {wtftw::handlers::default::restart} as FnOnce<(wtftw::window_manager::WindowManager, Rc<(dyn wtftw::window_system::WindowSystem + 'static)>, &'r GeneralConfig)>>::Output == wtftw::window_manager::WindowManager --> src/config.rs:65:5 | 65 | add_key_handler_str!(config, w, "q", modm, restart); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct wtftw::window_manager::WindowManager, found enum std::result::Result

Why does this specific line break the config but the rest of the lines don't? it compiles fine without it, is there any fix to this?

lvx-tenebris avatar Feb 04 '21 23:02 lvx-tenebris

where do you see the log of it crashing? I'm trying to change anything in the config but with no success, the terminal is still xterm despite changing to alacracitty, I'm unable to change the modkey... the config is located in ~/.wtftw/src/config,rs and I'm pressing alt + Q to reload. tbh even restarting the PC doesn't reload the config.

Niedzwiedzw avatar Feb 07 '21 15:02 Niedzwiedzw

You have to recompile the config using cargo build. My problem is during compile time.

lvx-tenebris avatar Feb 07 '21 15:02 lvx-tenebris

thanks for answering! cargo build when in ~/.wtftw/ directory or when in ~/Programming/wtftw (the cloned repo)?

Niedzwiedzw avatar Feb 07 '21 15:02 Niedzwiedzw

➜  ~ cd .wtftw/ && cargo build
warning: path `/home/niedzwiedz/.wtftw/src/config.rs` was erroneously implicitly accepted for library `config`,
please rename the file to `src/lib.rs` or set lib.path in Cargo.toml
    Updating git repository `https://github.com/Kintaro/wtftw.git`
    Updating git repository `https://github.com/Kintaro/wtftw-contrib.git`
    Updating crates.io index
error: no matching package named `wtftw` found
location searched: https://github.com/Kintaro/wtftw-contrib.git#e55f47df
required by package `wtftw_contrib v0.0.2 (https://github.com/Kintaro/wtftw-contrib.git#e55f47df)`
    ... which is depended on by `config v0.0.0 (/home/niedzwiedz/.wtftw)`
    ```

Niedzwiedzw avatar Feb 07 '21 15:02 Niedzwiedzw

https://github.com/Kintaro/wtftw-contrib/issues/25#issue-802975102 it might be related to that

Niedzwiedzw avatar Feb 07 '21 15:02 Niedzwiedzw

@vladimirlucifer Ok with some hacks I managed to resolve the dependency, the Cargo.toml had a bug in it I guess. As for your error I experienced it as well. Managed to hack it around with

add_key_handler_str!(config, w, "q", modm, |a, b, c| restart(a, b, c).unwrap());

seems like restart function returns a Result<_, _> now. I don't like how nothing really works for this project, is it even tested before pushing to master? xd

Niedzwiedzw avatar Feb 07 '21 15:02 Niedzwiedzw

ok config compiles but my config still doesn't seem to be taken into account, terminal is still xterm and mod key is still alt despite me changing it...

Niedzwiedzw avatar Feb 07 '21 15:02 Niedzwiedzw

@vladimirlucifer https://github.com/sminez/penrose this one is maintained and works like a charm

Niedzwiedzw avatar Feb 07 '21 16:02 Niedzwiedzw