diff --git a/packages/hurl/Cargo.toml b/packages/hurl/Cargo.toml index 0dd770d9850..3ec5babea90 100644 --- a/packages/hurl/Cargo.toml +++ b/packages/hurl/Cargo.toml @@ -8,7 +8,7 @@ description = "Hurl, run and test HTTP requests" documentation = "https://hurl.dev" homepage = "https://hurl.dev" repository = "https://github.com/Orange-OpenSource/hurl" -rust-version = "1.83.0" +rust-version = "1.84.0" [lib] name = "hurl" diff --git a/packages/hurl/src/html/entities.rs b/packages/hurl/src/html/entities.rs index 821fa746bce..b0c8074ce72 100644 --- a/packages/hurl/src/html/entities.rs +++ b/packages/hurl/src/html/entities.rs @@ -24,7 +24,7 @@ use lazy_static::lazy_static; // Generated from and // . // Map HTML5 named character references to the equivalent Unicode character(s). -const HTML5_ENTITIES: [(&str, &str); 2231] = [ +static HTML5_ENTITIES: [(&str, &str); 2231] = [ ("AElig", "\u{C6}"), ("AElig;", "\u{C6}"), ("AMP", "\u{26}"), diff --git a/packages/hurl/src/html/unescape.rs b/packages/hurl/src/html/unescape.rs index 5aa24e2f30f..3d60fec9fc8 100644 --- a/packages/hurl/src/html/unescape.rs +++ b/packages/hurl/src/html/unescape.rs @@ -24,7 +24,7 @@ use crate::html::entities::HTML5_ENTITIES_REF; // Ref https://html.spec.whatwg.org/#decimal-character-reference-start-state -const INVALID_CHAR: [(u32, &str); 34] = [ +static INVALID_CHAR: [(u32, &str); 34] = [ (0x00, "\u{fffd}"), // REPLACEMENT CHARACTER (0x0d, "\r"), // CARRIAGE RETURN (0x80, "\u{20ac}"), // EURO SIGN @@ -66,7 +66,7 @@ lazy_static! { INVALID_CHAR.iter().copied().collect(); } -const INVALID_CODEPOINTS: [u32; 126] = [ +static INVALID_CODEPOINTS: [u32; 126] = [ // 0x0001 to 0x0008 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, // 0x000E to 0x001F 0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, diff --git a/packages/hurl/src/http/response_decoding.rs b/packages/hurl/src/http/response_decoding.rs index 531043e34be..d28492e3b93 100644 --- a/packages/hurl/src/http/response_decoding.rs +++ b/packages/hurl/src/http/response_decoding.rs @@ -84,17 +84,17 @@ impl Response { /// Returns true if response is an HTML response. pub fn is_html(&self) -> bool { - self.headers.content_type().map_or(false, mimetype::is_html) + self.headers.content_type().is_some_and(mimetype::is_html) } /// Returns true if response is a JSON response. pub fn is_json(&self) -> bool { - self.headers.content_type().map_or(false, mimetype::is_json) + self.headers.content_type().is_some_and(mimetype::is_json) } /// Returns true if response is a XML response. pub fn is_xml(&self) -> bool { - self.headers.content_type().map_or(false, mimetype::is_xml) + self.headers.content_type().is_some_and(mimetype::is_xml) } /// Decompresses HTTP body response. diff --git a/packages/hurl/src/runner/hurl_file.rs b/packages/hurl/src/runner/hurl_file.rs index 8e3ba8f2296..3e8f7b31b64 100644 --- a/packages/hurl/src/runner/hurl_file.rs +++ b/packages/hurl/src/runner/hurl_file.rs @@ -257,7 +257,7 @@ pub fn run_entries( logger, ); - let has_error = results.last().map_or(false, |r| !r.errors.is_empty()); + let has_error = results.last().is_some_and(|r| !r.errors.is_empty()); entries_result.extend(results);