leftwm / leftwm-theme

A tool to help manage themes for LeftWM
BSD 3-Clause "New" or "Revised" License
117 stars 12 forks source link

[Regression] Forbid Unwraps; Enable Clippy Restricted Lints #27

Closed ixzh closed 3 years ago

ixzh commented 3 years ago

I have the following error:

    Retrieving themes from "community"
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/models/config.rs:219:69
stack backtrace:

What can I do?

   _______      bo@nana
 _ \______ -     os     Void Linux
| \  ___  \ |    kernel 5.13.15_1
| | /   \ | |    pkgs   856
| | \___/ | |    memory 1855M / 3838M
| \______ \_|    de     xmonad
 -_______\       shell  bash
mautamu commented 3 years ago

Is this a new installation? (Do you have themes already added/installed?)

Do you perchance know which git hash you’re using?

ixzh commented 3 years ago

it's new installation I have manually created the ~/.config/leftwm folder and having this error. im using git master.

mautamu commented 3 years ago

Ah, I have a theory about why this is happening. Do you mind going back to https://github.com/leftwm/leftwm-theme/commit/e6907a663ec56397ccbe4f1226ac0550ec6678f0 and seeing if that works for you?

mautamu commented 3 years ago

If it doesn't, you might need to create the ~/.config/leftwm/themes/ folder yourself

ixzh commented 3 years ago

it's the same: image

mautamu commented 3 years ago

I was able to reproduce this, leftwm-theme does work at e6907a6 for me (with no themes.toml or themes folder).

Steps to fix:

git checkout e6907a663ec56397ccbe4f1226ac0550ec6678f0
cargo build --release
./target/release/leftwm-theme update

The issue is the call to unwrap() introduced in 6957c635827364fe493ae2724f7715412111548f. Will try to come up with a patch later tonight.

mautamu commented 3 years ago

@ixzh Does 1f1d521af8a11589a2ce9c6027cd7c7f64cdca1c work for you?

We'll need to add pedantic clippy lints to the workflow to catch this in the future. Could also add a blank-dir test.

ixzh commented 3 years ago

it works! Thanks and close this issue?

mautamu commented 3 years ago

We can hold off on that for now, I’ll rename this to enable protective clippy lints.

mautamu commented 3 years ago

Thanks for reporting this @ixzh! Glad we got it working again for you.