From 67b3621be326c98e0c2677be85b246a105291ce4 Mon Sep 17 00:00:00 2001 From: Drakulix Date: Fri, 15 Sep 2017 15:57:30 +0200 Subject: [PATCH] drm: reformat --- src/backend/drm/mod.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) 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)); }