From efec43b3b8827820cf35fe1b73d8e33f5fe84eb4 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 20 Jun 2026 01:16:50 +0900 Subject: refactor: auto-fix clippy warnings --- crates/shirabe/src/console/github_action_error.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/src/console/github_action_error.rs') diff --git a/crates/shirabe/src/console/github_action_error.rs b/crates/shirabe/src/console/github_action_error.rs index 963f5c1..7475505 100644 --- a/crates/shirabe/src/console/github_action_error.rs +++ b/crates/shirabe/src/console/github_action_error.rs @@ -15,13 +15,13 @@ impl GithubActionError { } pub fn emit(&mut self, message: &str, file: Option<&str>, line: Option) { - if Platform::get_env("GITHUB_ACTIONS").map_or(false, |v| !v.is_empty()) - && !Platform::get_env("COMPOSER_TESTS_ARE_RUNNING").map_or(false, |v| !v.is_empty()) + if Platform::get_env("GITHUB_ACTIONS").is_some_and(|v| !v.is_empty()) + && Platform::get_env("COMPOSER_TESTS_ARE_RUNNING").is_none_or(|v| v.is_empty()) { let message = self.escape_data(message); - let file_truthy = file.map_or(false, |f| !f.is_empty()); - let line_truthy = line.map_or(false, |l| l != 0); + let file_truthy = file.is_some_and(|f| !f.is_empty()); + let line_truthy = line.is_some_and(|l| l != 0); if file_truthy && line_truthy { let file = self.escape_property(file.unwrap()); @@ -45,8 +45,8 @@ impl GithubActionError { // see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L80-L85 let data = data.replace('%', "%25"); let data = data.replace('\r', "%0D"); - let data = data.replace('\n', "%0A"); - data + + data.replace('\n', "%0A") } fn escape_property(&self, property: &str) -> String { @@ -55,7 +55,7 @@ impl GithubActionError { let property = property.replace('\r', "%0D"); let property = property.replace('\n', "%0A"); let property = property.replace(':', "%3A"); - let property = property.replace(',', "%2C"); - property + + property.replace(',', "%2C") } } -- cgit v1.3.1