diff options
author | Mukilan Thiyagarajan <mukilan@igalia.com> | 2024-12-12 12:56:16 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-12 07:26:16 +0000 |
commit | 7fcde1f7a30138544f8ad1b279c5e4047e643831 (patch) | |
tree | 524be9953b959288039f45f66783cc07b339b5bc /components/script | |
parent | 26f61103d62837e1f8dc9f646b9bfdd36949cd4f (diff) | |
download | servo-7fcde1f7a30138544f8ad1b279c5e4047e643831.tar.gz servo-7fcde1f7a30138544f8ad1b279c5e4047e643831.zip |
build: upgrade rustc to 1.81.0 (#34270)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/body.rs | 6 | ||||
-rw-r--r-- | components/script/textinput.rs | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/components/script/body.rs b/components/script/body.rs index 32a590dd517..6d7dea4c0ad 100644 --- a/components/script/body.rs +++ b/components/script/body.rs @@ -873,11 +873,7 @@ fn run_form_data_algorithm( mime: &[u8], can_gc: CanGc, ) -> Fallible<FetchedData> { - let mime_str = if let Ok(s) = str::from_utf8(mime) { - s - } else { - "" - }; + let mime_str = str::from_utf8(mime).unwrap_or_default(); let mime: Mime = mime_str .parse() .map_err(|_| Error::Type("Inappropriate MIME-type for Body".to_string()))?; diff --git a/components/script/textinput.rs b/components/script/textinput.rs index 82f1c6c9447..38fbf3543d1 100644 --- a/components/script/textinput.rs +++ b/components/script/textinput.rs @@ -1037,7 +1037,7 @@ impl<T: ClipboardProvider> TextInput<T> { // https://html.spec.whatwg.org/multipage/#textarea-line-break-normalisation-transformation content .replace("\r\n", "\n") - .split(|c| c == '\n' || c == '\r') + .split(['\n', '\r']) .map(DOMString::from) .collect() } else { |