From a1c7e6908a26e10f6e1f23a51721664b5e2d838d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 17 May 2026 02:53:53 +0900 Subject: chore(style): cargo fmt --- crates/shirabe/src/config/config_source_interface.rs | 17 ++++++++++++++--- crates/shirabe/src/config/json_config_source.rs | 18 ++++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) (limited to 'crates/shirabe/src/config') diff --git a/crates/shirabe/src/config/config_source_interface.rs b/crates/shirabe/src/config/config_source_interface.rs index 9f3321c..2a48635 100644 --- a/crates/shirabe/src/config/config_source_interface.rs +++ b/crates/shirabe/src/config/config_source_interface.rs @@ -4,9 +4,20 @@ use indexmap::IndexMap; use shirabe_php_shim::PhpMixed; pub trait ConfigSourceInterface { - fn add_repository(&mut self, name: &str, config: Option>, append: bool) -> anyhow::Result<()>; - - fn insert_repository(&mut self, name: &str, config: Option>, reference_name: &str, offset: i64) -> anyhow::Result<()>; + fn add_repository( + &mut self, + name: &str, + config: Option>, + append: bool, + ) -> anyhow::Result<()>; + + fn insert_repository( + &mut self, + name: &str, + config: Option>, + reference_name: &str, + offset: i64, + ) -> anyhow::Result<()>; fn set_repository_url(&mut self, name: &str, url: &str) -> anyhow::Result<()>; diff --git a/crates/shirabe/src/config/json_config_source.rs b/crates/shirabe/src/config/json_config_source.rs index 264b0e1..5dc5e8d 100644 --- a/crates/shirabe/src/config/json_config_source.rs +++ b/crates/shirabe/src/config/json_config_source.rs @@ -3,8 +3,8 @@ use anyhow::Result; use indexmap::IndexMap; use shirabe_php_shim::{ - array_unshift, call_user_func_array, chmod, explode, file_get_contents, file_put_contents, - implode, is_writable, sprintf, PhpMixed, RuntimeException, Silencer, PHP_EOL, + PHP_EOL, PhpMixed, RuntimeException, Silencer, array_unshift, call_user_func_array, chmod, + explode, file_get_contents, file_put_contents, implode, is_writable, sprintf, }; use crate::config::config_source_interface::ConfigSourceInterface; @@ -198,9 +198,12 @@ impl JsonConfigSource { } } } - self.file.write(config, shirabe_php_shim::JSON_UNESCAPED_SLASHES - | shirabe_php_shim::JSON_PRETTY_PRINT - | shirabe_php_shim::JSON_UNESCAPED_UNICODE)?; + self.file.write( + config, + shirabe_php_shim::JSON_UNESCAPED_SLASHES + | shirabe_php_shim::JSON_PRETTY_PRINT + | shirabe_php_shim::JSON_UNESCAPED_UNICODE, + )?; } // TODO(phase-b): use anyhow::Result> to model PHP try/catch @@ -320,7 +323,10 @@ impl ConfigSourceInterface for JsonConfigSource { let _ = (cfg, args); todo!("setRepositoryUrl fallback closure body"); }), - vec![PhpMixed::String(name.to_string()), PhpMixed::String(url.to_string())], + vec![ + PhpMixed::String(name.to_string()), + PhpMixed::String(url.to_string()), + ], ) } -- cgit v1.3.1