diff --git a/src/backend/drm/mod.rs b/src/backend/drm/mod.rs index 9075859..90e3edc 100644 --- a/src/backend/drm/mod.rs +++ b/src/backend/drm/mod.rs @@ -366,17 +366,33 @@ impl DrmDevice { // check if the given connectors and crtc match let connectors = connectors.into(); // get all encoders supported by this device - let mut set = self.context.head().head().resource_handles()?.encoders().iter().cloned().collect::>(); + let mut set = self.context + .head() + .head() + .resource_handles()? + .encoders() + .iter() + .cloned() + .collect::>(); for connector in connectors.iter() { let info = connector::Info::load_from_device(self.context.head().head(), *connector)?; // then check for every connector which encoders it does support - let conn_set = info.encoders().iter().cloned().collect::>(); + let conn_set = info.encoders() + .iter() + .cloned() + .collect::>(); // and update the list of supported encoders for this combination - set = set.intersection(&conn_set).cloned().collect::>(); + set = set.intersection(&conn_set) + .cloned() + .collect::>(); } // check if there is any encoder left that can be connected to the crtc - let encoders: Vec = set.iter().map(|handle| encoder::Info::load_from_device(self.context.head().head(), *handle).map_err(DrmError::from)).collect::, DrmError>>()?; + let encoders: Vec = set.iter() + .map(|handle| { + encoder::Info::load_from_device(self.context.head().head(), *handle).map_err(DrmError::from) + }) + .collect::, DrmError>>()?; if !encoders.iter().any(|enc| enc.supports_crtc(crtc)) { return Err(DrmError::Crtc(CrtcError::NoSuitableEncoder)); }