Skip to content

Commit 4a04e30

Browse files
andrewpollackCQ Bot
authored and
CQ Bot
committed
[rust toolchain] Removing lifetime reference from closure
Github issue: rust-lang/rust#98835 Breakage: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/rust_toolchain.core.x64-release-subbuild/b8806754452009409777/overview Change-Id: I9b2a76324a3a1e7310066fe87169babaeefb19bc Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/707812 Reviewed-by: Kevin Twidle <[email protected]> Fuchsia-Auto-Submit: Andrew Pollack <[email protected]> Commit-Queue: Auto-Submit <[email protected]>
1 parent a8be52d commit 4a04e30

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/ui/bin/brightness_manager/src/sensor.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fn open_input_report_device(path: &str) -> Result<InputDeviceProxy, Error> {
4545
Ok(proxy)
4646
}
4747

48-
async fn open_sensor_input_report_reader<'a>() -> Result<AmbientLightInputReportReaderProxy, Error>
48+
async fn open_sensor_input_report_reader() -> Result<AmbientLightInputReportReaderProxy, Error>
4949
{
5050
let input_report_directory = "/dev/class/input-report";
5151
let dir_path = Path::new(input_report_directory);
@@ -56,12 +56,11 @@ async fn open_sensor_input_report_reader<'a>() -> Result<AmbientLightInputReport
5656
let device_path = device_path.to_str().expect("Bad path");
5757
let device = open_input_report_device(device_path)?;
5858

59-
let get_sensor_input =
60-
|descriptor: &'a DeviceDescriptor| -> Result<&'a Vec<SensorInputDescriptor>, Error> {
61-
let sensor = descriptor.sensor.as_ref().context("device has no sensor")?;
62-
let input_desc = sensor.input.as_ref().context("sensor has no input descriptor")?;
63-
Ok(input_desc)
64-
};
59+
fn get_sensor_input(descriptor: &DeviceDescriptor) -> Result<&Vec<SensorInputDescriptor>, Error> {
60+
let sensor = descriptor.sensor.as_ref().context("device has no sensor")?;
61+
let input_desc = sensor.input.as_ref().context("sensor has no input descriptor")?;
62+
Ok(input_desc)
63+
}
6564

6665
if let Ok(descriptor) = device.get_descriptor().await {
6766
match get_sensor_input(&descriptor) {

0 commit comments

Comments
 (0)