diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 09:54:30 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 09:54:30 +0900 |
| commit | 2914770fba6b3cc03a68fae493f60470a41962ec (patch) | |
| tree | 90802d00854c302899af4d8efe0e824e62e5b9db /crates/shirabe/src/json | |
| parent | 44b443282644fc631ce722baf6d143f354dc62d3 (diff) | |
| download | php-shirabe-2914770fba6b3cc03a68fae493f60470a41962ec.tar.gz php-shirabe-2914770fba6b3cc03a68fae493f60470a41962ec.tar.zst php-shirabe-2914770fba6b3cc03a68fae493f60470a41962ec.zip | |
refactor: re-export module items to shorten import paths
Diffstat (limited to 'crates/shirabe/src/json')
| -rw-r--r-- | crates/shirabe/src/json/json_file.rs | 28 | ||||
| -rw-r--r-- | crates/shirabe/src/json/json_formatter.rs | 2 | ||||
| -rw-r--r-- | crates/shirabe/src/json/json_manipulator.rs | 6 | ||||
| -rw-r--r-- | crates/shirabe/src/json/mod.rs | 5 |
4 files changed, 21 insertions, 20 deletions
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs index 4a2d079..3340cae 100644 --- a/crates/shirabe/src/json/json_file.rs +++ b/crates/shirabe/src/json/json_file.rs @@ -1,13 +1,13 @@ //! ref: composer/src/Composer/Json/JsonFile.php use crate::io::io_interface; -use crate::util::silencer::Silencer; +use crate::util::Silencer; use anyhow::Result; use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; -use shirabe_external_packages::json_schema::validator::Validator; -use shirabe_external_packages::seld::json_lint::json_parser::JsonParser; -use shirabe_external_packages::seld::json_lint::parsing_exception::ParsingException; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; +use shirabe_external_packages::json_schema::Validator; +use shirabe_external_packages::seld::json_lint::JsonParser; +use shirabe_external_packages::seld::json_lint::ParsingException; use shirabe_php_shim::{ InvalidArgumentException, JSON_ERROR_CTRL_CHAR, JSON_ERROR_DEPTH, JSON_ERROR_NONE, JSON_ERROR_STATE_MISMATCH, JSON_ERROR_UTF8, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, @@ -17,11 +17,11 @@ use shirabe_php_shim::{ str_repeat, strlen, strpos, usleep, }; -use crate::downloader::transport_exception::TransportException; -use crate::io::io_interface::IOInterface; -use crate::json::json_validation_exception::JsonValidationException; -use crate::util::filesystem::Filesystem; -use crate::util::http_downloader::HttpDownloader; +use crate::downloader::TransportException; +use crate::io::IOInterface; +use crate::json::JsonValidationException; +use crate::util::Filesystem; +use crate::util::HttpDownloader; /// Reads/writes json files. #[derive(Debug)] @@ -417,16 +417,12 @@ impl JsonFile { return Preg::replace_callback( r"#^ {4,}#m", move |m: &indexmap::IndexMap< - shirabe_external_packages::composer::pcre::preg::CaptureKey, + shirabe_external_packages::composer::pcre::CaptureKey, String, >| -> String { let whole = m - .get( - &shirabe_external_packages::composer::pcre::preg::CaptureKey::ByIndex( - 0, - ), - ) + .get(&shirabe_external_packages::composer::pcre::CaptureKey::ByIndex(0)) .map(|s| s.as_str()) .unwrap_or(""); str_repeat(&indent_owned, (strlen(whole) / 4) as usize) diff --git a/crates/shirabe/src/json/json_formatter.rs b/crates/shirabe/src/json/json_formatter.rs index 47680b1..260bf1e 100644 --- a/crates/shirabe/src/json/json_formatter.rs +++ b/crates/shirabe/src/json/json_formatter.rs @@ -1,6 +1,6 @@ //! ref: composer/src/Composer/Json/JsonFormatter.php -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{PhpMixed, function_exists, mb_convert_encoding, pack}; pub struct JsonFormatter; diff --git a/crates/shirabe/src/json/json_manipulator.rs b/crates/shirabe/src/json/json_manipulator.rs index 7dee06f..c9ca7f7 100644 --- a/crates/shirabe/src/json/json_manipulator.rs +++ b/crates/shirabe/src/json/json_manipulator.rs @@ -2,7 +2,7 @@ use indexmap::IndexMap; -use shirabe_external_packages::composer::pcre::preg::{CaptureKey, Preg}; +use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ ArrayObject, InvalidArgumentException, LogicException, PREG_BACKTRACK_LIMIT_ERROR, PhpMixed, RuntimeException, StdClass, addcslashes, array_key_exists, array_keys, array_reverse, count, @@ -11,8 +11,8 @@ use shirabe_php_shim::{ trim, uksort, }; -use crate::json::json_file::JsonFile; -use crate::repository::platform_repository::PlatformRepository; +use crate::json::JsonFile; +use crate::repository::PlatformRepository; #[derive(Debug)] pub struct JsonManipulator { diff --git a/crates/shirabe/src/json/mod.rs b/crates/shirabe/src/json/mod.rs index 3e5f22c..0863529 100644 --- a/crates/shirabe/src/json/mod.rs +++ b/crates/shirabe/src/json/mod.rs @@ -2,3 +2,8 @@ pub mod json_file; pub mod json_formatter; pub mod json_manipulator; pub mod json_validation_exception; + +pub use json_file::*; +pub use json_formatter::*; +pub use json_manipulator::*; +pub use json_validation_exception::*; |
