diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-22 01:43:34 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-22 01:44:05 +0900 |
| commit | 6739da8a8e271a82d1bf8ca79bba58640ae6e743 (patch) | |
| tree | ce397b02662cf3c101cb36545b0a6c94ddc21826 /crates/shirabe-php-shim/src/lib.rs | |
| parent | 0b06f54103490e3ce5658e82bbc0119633e26cd8 (diff) | |
| download | php-shirabe-6739da8a8e271a82d1bf8ca79bba58640ae6e743.tar.gz php-shirabe-6739da8a8e271a82d1bf8ca79bba58640ae6e743.tar.zst php-shirabe-6739da8a8e271a82d1bf8ca79bba58640ae6e743.zip | |
refactor(php-shim): remove unnecessary methods
Diffstat (limited to 'crates/shirabe-php-shim/src/lib.rs')
| -rw-r--r-- | crates/shirabe-php-shim/src/lib.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/crates/shirabe-php-shim/src/lib.rs b/crates/shirabe-php-shim/src/lib.rs index f01f16c..b265111 100644 --- a/crates/shirabe-php-shim/src/lib.rs +++ b/crates/shirabe-php-shim/src/lib.rs @@ -77,27 +77,10 @@ impl PhpMixed { } } - pub fn as_str(&self) -> Option<&str> { - self.as_string() - } - pub fn is_null(&self) -> bool { matches!(self, PhpMixed::Null) } - /// Treats PhpMixed::Null as None, everything else as Some. - pub fn is_none(&self) -> bool { - self.is_null() - } - - pub fn is_some(&self) -> bool { - !self.is_null() - } - - pub fn as_string_opt(&self) -> Option<&str> { - self.as_string() - } - pub fn get(&self, key: &str) -> Option<&PhpMixed> { self.as_array().and_then(|m| m.get(key).map(|v| v.as_ref())) } @@ -122,20 +105,11 @@ impl PhpMixed { self } - pub fn as_ref(&self) -> Option<&PhpMixed> { - self.as_opt() - } - /// Treats PhpMixed::Null as None and applies the function for chaining. pub fn and_then<U, F: FnOnce(&PhpMixed) -> Option<U>>(&self, f: F) -> Option<U> { self.as_opt().and_then(f) } - /// Counterpart to `Any::as_any` for trait-object call sites that downcast. - pub fn as_any(&self) -> &dyn std::any::Any { - self - } - /// Treats `Null` and `Bool(false)` as the falsy case, anything else as Some. pub fn ok_or_else<E, F: FnOnce() -> E>(self, err: F) -> Result<PhpMixed, E> { match self { |
