Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
XuShaohua committed Feb 19, 2025
1 parent 73c2bdb commit 6e56343
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/zu-util/src/icon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ pub const TEMPLATE_FILE: &str = include_str!("template.rs");
/// Current `ZU_ICON_UPDATE=1` environment is used.
#[must_use]
pub fn need_update() -> bool {
std::env::var_os(UPDATE_KEY).map_or(false, |val| !val.is_empty())
std::env::var_os(UPDATE_KEY).is_some_and(|val| !val.is_empty())
}

/// Check whether icon modules shall be refreshed.
///
/// Current `ZU_ICON_UPDATE="name"` environment is used.
#[must_use]
pub fn need_update_with_name(name: &str) -> bool {
std::env::var_os(UPDATE_KEY).map_or(false, |val| val == name)
std::env::var_os(UPDATE_KEY).is_some_and(|val| val == name)
}

/// Get inner html of an svg file, without `<svg>` root tag.
#[must_use]
pub fn get_svg_inner(s: &str) -> Option<&str> {
let start_index= s.find("<svg")?;
let start_index = s.find("<svg")?;
let end_index = s.find("</svg>")?;

let mut start_index_end = start_index;
Expand Down
2 changes: 1 addition & 1 deletion crates/zuicon-material/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ pub use {module_name}::{node_name};
}

fn run() -> Result<(), Box<dyn Error>> {
if std::env::var_os("MATERIAL_DOWNLOAD").map_or(false, |val| !val.is_empty()) {
if std::env::var_os("MATERIAL_DOWNLOAD").is_some_and(|val| !val.is_empty()) {
// 1. Download icon index
let icons_index = download_index()?;

Expand Down

0 comments on commit 6e56343

Please sign in to comment.