Update to rust 1.85 (#35628)

* Update to rust 1.85

This is needed for cargo-deny

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Upgrade crown

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Clippy fixes

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Re-upgrade cargo-deny to 0.18

Keeping it locked to 0.18 just in case they
update their required rustc version again

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-02-24 18:44:35 +01:00 committed by GitHub
parent d78f7b2d78
commit be6765447d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 88 additions and 105 deletions

View file

@ -1114,7 +1114,7 @@ impl Document {
if implicit_transaction {
self.begin_focus_transaction();
}
if elem.map_or(true, |e| e.is_focusable_area()) {
if elem.is_none_or(|e| e.is_focusable_area()) {
*self.focus_transaction.borrow_mut() =
FocusTransaction::InTransaction(elem.map(Dom::from_ref));
}
@ -1795,7 +1795,7 @@ impl Document {
let target_has_changed = prev_mouse_over_target
.get()
.as_ref()
.map_or(true, |old_target| old_target != &new_target);
.is_none_or(|old_target| old_target != &new_target);
// Here we know the target has changed, so we must update the state,
// dispatch mouseout to the previous one, mouseover to the new one.

View file

@ -1639,7 +1639,7 @@ pub(crate) trait FormControl: DomObject {
let has_form_attr = elem.has_attribute(&local_name!("form"));
let same_subtree = self
.form_owner()
.map_or(true, |form| elem.is_in_same_home_subtree(&*form));
.is_none_or(|form| elem.is_in_same_home_subtree(&*form));
self.unregister_if_necessary();

View file

@ -837,10 +837,7 @@ impl HTMLInputElement {
},
// https://html.spec.whatwg.org/multipage/#file-upload-state-(type%3Dfile)%3Asuffering-from-being-missing
InputType::File => {
self.Required() &&
self.filelist
.get()
.map_or(true, |files| files.Length() == 0)
self.Required() && self.filelist.get().is_none_or(|files| files.Length() == 0)
},
// https://html.spec.whatwg.org/multipage/#the-required-attribute%3Asuffering-from-being-missing
_ => {

View file

@ -1317,7 +1317,7 @@ impl Node {
}
pub(crate) fn is_display_none(&self) -> bool {
self.style_data.borrow().as_ref().map_or(true, |data| {
self.style_data.borrow().as_ref().is_none_or(|data| {
data.element_data
.borrow()
.styles
@ -2184,8 +2184,7 @@ impl Node {
) {
node.owner_doc().add_script_and_layout_blocker();
debug_assert!(*node.owner_doc() == *parent.owner_doc());
debug_assert!(child.map_or(true, |child| Some(parent) ==
child.GetParentNode().as_deref()));
debug_assert!(child.is_none_or(|child| Some(parent) == child.GetParentNode().as_deref()));
// Step 1.
let count = if node.is::<DocumentFragment>() {

View file

@ -78,10 +78,10 @@ impl PerformanceEntryList {
.entries
.iter()
.filter(|e| {
name.as_ref().map_or(true, |name_| *e.name() == *name_) &&
name.as_ref().is_none_or(|name_| *e.name() == *name_) &&
entry_type
.as_ref()
.map_or(true, |type_| *e.entry_type() == *type_)
.is_none_or(|type_| *e.entry_type() == *type_)
})
.cloned()
.collect::<Vec<DomRoot<PerformanceEntry>>>();

View file

@ -432,7 +432,7 @@ impl WebGLProgram {
let (size, type_) = {
let (base_name, array_index) = match parse_uniform_name(&name) {
Some((name, index)) if index.map_or(true, |i| i >= 0) => (name, index),
Some((name, index)) if index.is_none_or(|i| i >= 0) => (name, index),
_ => return Ok(None),
};

View file

@ -670,7 +670,7 @@ impl WebGLRenderingContext {
// or UNSIGNED_SHORT_5_5_5_1, a Uint16Array must be supplied.
// or FLOAT, a Float32Array must be supplied.
// If the types do not match, an INVALID_OPERATION error is generated.
let data_type_matches = data.as_ref().map_or(true, |buffer| {
let data_type_matches = data.as_ref().is_none_or(|buffer| {
Some(data_type.sized_data_type()) ==
array_buffer_type_to_sized_type(buffer.get_array_type()) &&
data_type.required_webgl_version() <= self.webgl_version()

View file

@ -349,7 +349,7 @@ impl WebSocketMethods<crate::DomTypeHolder> for WebSocket {
// https://html.spec.whatwg.org/multipage/#dom-websocket-send
fn Send(&self, data: USVString) -> ErrorResult {
let data_byte_len = data.0.as_bytes().len() as u64;
let data_byte_len = data.0.len() as u64;
let send_data = self.send_impl(data_byte_len)?;
if send_data {
@ -417,7 +417,7 @@ impl WebSocketMethods<crate::DomTypeHolder> for WebSocket {
}
}
if let Some(ref reason) = reason {
if reason.0.as_bytes().len() > 123 {
if reason.0.len() > 123 {
//reason cannot be larger than 123 bytes
return Err(Error::Syntax);
}

View file

@ -286,7 +286,7 @@ impl WritableStreamDefaultWriter {
if !self
.stream
.get()
.map_or(false, |current_stream| current_stream == stream)
.is_some_and(|current_stream| current_stream == stream)
{
let promise = Promise::new(global, can_gc);
promise.reject_error(Error::Type(