diff options
Diffstat (limited to 'crates/shirabe/src/json/json_file.rs')
| -rw-r--r-- | crates/shirabe/src/json/json_file.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs index c1fa495..d08e207 100644 --- a/crates/shirabe/src/json/json_file.rs +++ b/crates/shirabe/src/json/json_file.rs @@ -401,7 +401,11 @@ impl JsonFile { /// @param int $options json_encode options (defaults to JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) /// @param string $indent Indentation string /// @return string Encoded json - pub fn encode(data: &PhpMixed, options: i64, indent: &str) -> String { + pub fn encode(data: &PhpMixed, options: i64) -> String { + Self::encode_with_indent(data, options, Self::INDENT_DEFAULT) + } + + pub fn encode_with_indent(data: &PhpMixed, options: i64, indent: &str) -> String { let json = json_encode_ex(data, options); let json = match json { |
