diff options
Diffstat (limited to 'crates/shirabe/src/util')
| -rw-r--r-- | crates/shirabe/src/util/filesystem.rs | 10 | ||||
| -rw-r--r-- | crates/shirabe/src/util/url.rs | 4 |
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() { |
