aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/util
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-22 01:43:34 +0900
committernsfisis <nsfisis@gmail.com>2026-05-22 01:44:05 +0900
commit6739da8a8e271a82d1bf8ca79bba58640ae6e743 (patch)
treece397b02662cf3c101cb36545b0a6c94ddc21826 /crates/shirabe/src/util
parent0b06f54103490e3ce5658e82bbc0119633e26cd8 (diff)
downloadphp-shirabe-6739da8a8e271a82d1bf8ca79bba58640ae6e743.tar.gz
php-shirabe-6739da8a8e271a82d1bf8ca79bba58640ae6e743.tar.zst
php-shirabe-6739da8a8e271a82d1bf8ca79bba58640ae6e743.zip
refactor(php-shim): remove unnecessary methods
Diffstat (limited to 'crates/shirabe/src/util')
-rw-r--r--crates/shirabe/src/util/filesystem.rs10
-rw-r--r--crates/shirabe/src/util/url.rs4
2 files changed, 7 insertions, 7 deletions
diff --git a/crates/shirabe/src/util/filesystem.rs b/crates/shirabe/src/util/filesystem.rs
index a51b0f3..96316e9 100644
--- a/crates/shirabe/src/util/filesystem.rs
+++ b/crates/shirabe/src/util/filesystem.rs
@@ -419,7 +419,7 @@ impl Filesystem {
if str_contains(&e.message, "Bad address") {
let source_handle = fopen(source, "r");
let target_handle = fopen(&target, "w");
- if source_handle.is_none() || target_handle.is_none() {
+ if source_handle.is_null() || target_handle.is_null() {
return Err(e.into());
}
while !feof(source_handle.clone()) {
@@ -1035,14 +1035,14 @@ impl Filesystem {
pub fn safe_copy(&self, source: &str, target: &str) -> anyhow::Result<()> {
if !file_exists(target) || !file_exists(source) || !self.files_are_equal(source, target) {
let source_handle = fopen(source, "r");
- if source_handle.is_none() {
+ if source_handle.is_null() {
return Err(anyhow::anyhow!(
"Could not open \"{}\" for reading.",
source
));
}
let target_handle = fopen(target, "w+");
- if target_handle.is_none() {
+ if target_handle.is_null() {
return Err(anyhow::anyhow!(
"Could not open \"{}\" for writing.",
target
@@ -1070,11 +1070,11 @@ impl Filesystem {
// Check if content is different
let a_handle = fopen(a, "rb");
- if a_handle.is_none() {
+ if a_handle.is_null() {
return false;
}
let b_handle = fopen(b, "rb");
- if b_handle.is_none() {
+ if b_handle.is_null() {
return false;
}
diff --git a/crates/shirabe/src/util/url.rs b/crates/shirabe/src/util/url.rs
index a6736aa..8bcd73e 100644
--- a/crates/shirabe/src/util/url.rs
+++ b/crates/shirabe/src/util/url.rs
@@ -11,7 +11,7 @@ pub struct Url;
impl Url {
pub fn update_dist_reference(config: &Config, mut url: String, r#ref: &str) -> String {
let host = parse_url(&url, PHP_URL_HOST)
- .as_string_opt()
+ .as_string()
.map(|s| s.to_string())
.unwrap_or_default();
@@ -128,7 +128,7 @@ impl Url {
}
let mut origin = parse_url(url, PHP_URL_HOST)
- .as_string_opt()
+ .as_string()
.map(|s| s.to_string())
.unwrap_or_default();
if let Some(port) = parse_url(url, PHP_URL_PORT).as_int() {