Skip to content

Commit

Permalink
drm/atomic: Get rid of &mut dyn Iterator
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Meissl <[email protected]>
  • Loading branch information
Drakulix and cmeissl authored Jan 13, 2025
1 parent fcaa9b6 commit 6da1b06
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/backend/drm/surface/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ impl AtomicDrmSurface {
self.crtc,
Some(pending.blob),
pending.vrr,
&mut [conn].iter(),
&mut [].iter(),
[&conn],
[],
[&plane_state],
)?;
self.fd
Expand Down Expand Up @@ -414,8 +414,8 @@ impl AtomicDrmSurface {
self.crtc,
Some(pending.blob),
pending.vrr,
&mut [].iter(),
&mut [conn].iter(),
[].iter(),
[&conn],
[&plane_state],
)?;
self.fd
Expand Down Expand Up @@ -472,8 +472,8 @@ impl AtomicDrmSurface {
self.crtc,
Some(pending.blob),
pending.vrr,
&mut added,
&mut removed,
added,
removed,
[&plane_state],
)?;

Expand Down Expand Up @@ -526,8 +526,8 @@ impl AtomicDrmSurface {
self.crtc,
Some(new_blob),
pending.vrr,
&mut pending.connectors.iter(),
&mut [].iter(),
pending.connectors.iter(),
[],
[&plane_state],
)?;
if let Err(err) = self
Expand Down Expand Up @@ -700,17 +700,17 @@ impl AtomicDrmSurface {

let current_conns = current.connectors.clone();
let pending_conns = pending.connectors.clone();
let mut removed = current_conns.difference(&pending_conns);
let mut added = pending_conns.difference(&current_conns);
let removed = current_conns.difference(&pending_conns);
let added = pending_conns.difference(&current_conns);
let prop_mapping = self.prop_mapping.read().unwrap();

let req = AtomicRequest::build_request(
&prop_mapping,
self.crtc,
Some(pending.blob),
pending.vrr,
&mut added,
&mut removed,
added,
removed,
&*planes,
)?;

Expand Down Expand Up @@ -749,7 +749,7 @@ impl AtomicDrmSurface {
// we need the differences to know, which connectors need to change properties
let current_conns = current.connectors.clone();
let pending_conns = pending.connectors.clone();
let mut removed = current_conns.difference(&pending_conns);
let removed = current_conns.difference(&pending_conns);

for conn in removed.clone() {
if let Ok(info) = self.fd.get_connector(*conn, false) {
Expand Down Expand Up @@ -781,8 +781,8 @@ impl AtomicDrmSurface {
self.crtc,
Some(pending.blob),
pending.vrr,
&mut pending_conns.iter(),
&mut removed,
&pending_conns,
removed,
&*planes,
)?;

Expand Down Expand Up @@ -868,8 +868,8 @@ impl AtomicDrmSurface {
self.crtc,
None,
self.state.read().unwrap().vrr,
&mut [].iter(),
&mut [].iter(),
[],
[],
&*planes,
)?;

Expand Down Expand Up @@ -1609,8 +1609,8 @@ impl<'a> AtomicRequest<'a> {
crtc: crtc::Handle,
blob: Option<property::Value<'static>>,
vrr: bool,
new_connectors: &mut dyn Iterator<Item = &connector::Handle>,
removed_connectors: &mut dyn Iterator<Item = &connector::Handle>,
new_connectors: impl IntoIterator<Item = &'a connector::Handle>,
removed_connectors: impl IntoIterator<Item = &'a connector::Handle>,
planes: impl IntoIterator<Item = &'a PlaneState<'a>>,
) -> Result<AtomicRequest<'a>, Error> {
let mut req = AtomicRequest::new(mapping);
Expand Down

0 comments on commit 6da1b06

Please sign in to comment.