Use strip_prefix() instead of range access

This commit is contained in:
Kitaiti Makoto 2021-01-15 23:00:15 +09:00
parent a236f33269
commit bbd415c392

View File

@ -164,8 +164,8 @@ impl Default for LogoConfig {
}; };
let mut custom_icons = env::vars() let mut custom_icons = env::vars()
.filter_map(|(var, val)| { .filter_map(|(var, val)| {
if var.starts_with("PLUME_LOGO_") { if let Some(size) = var.strip_prefix("PLUME_LOGO_") {
Some((var[11..].to_owned(), val)) Some((size.to_owned(), val))
} else { } else {
None None
} }