Skip to content

Commit

Permalink
convert icon vars to chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Localghost385 committed Aug 29, 2024
1 parent 60edf3a commit 6229771
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/info/langs/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tokei;
include!(concat!(env!("OUT_DIR"), "/language.rs"));

const LANGUAGES_BAR_LENGTH: usize = 26;
const DEFAULT_ICON: &str = "\u{25CF}";
const DEFAULT_ICON: char = '\u{25CF}';

#[derive(Serialize)]
pub struct LanguageWithPercentage {
Expand Down Expand Up @@ -114,7 +114,7 @@ struct LanguageDisplayData {
language: String,
percentage: f64,
chip_color: DynColors,
icon: &'static str,
icon: char,
}

fn prepare_languages(
Expand Down
4 changes: 2 additions & 2 deletions src/info/langs/language.tera
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ impl Language {
}
}

pub fn get_icon(&self) -> Option<&'static str> {
pub fn get_icon(&self) -> Option<char> {
match self {
{% for language, attrs in languages -%}
{% if attrs.icon is defined %}Language::{{ language }} => Some("{{ attrs.icon }}"),{% else %}Language::{{ language }} => None,{% endif %}
{% if attrs.icon is defined %}Language::{{ language }} => Some('{{ attrs.icon }}'),{% else %}Language::{{ language }} => None,{% endif %}
{% endfor %}
}
}
Expand Down

0 comments on commit 6229771

Please sign in to comment.