commit | 488985e7db43107a21e8d39d4bb0f074bcd61622 | [log] [tgz] |
---|---|---|
author | Mukesh Agrawal <quiche@google.com> | Fri Jul 14 19:56:29 2023 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jul 14 19:56:29 2023 +0000 |
tree | 35bad50f8604ac582c5560a69d49b16f3bd65bb2 | |
parent | e180a6d54568a118e296fffcac20735e8db7d928 [diff] |
[ui][input-pipeline] remove unused `Clone` from LightSensorHandler `LightSensorHandler::new()` returns an `Rc<Self>`. Hence: - every instance of `LightSensorHandler` created by `new()` implements `Clone`, [by virtue of `Rc`](https://doc.rust-lang.org/std/rc/struct.Rc.html#impl-Clone-for-Rc%3CT%3E) - there's no need for `LightSensorHandler` to implement `Clone` itself The primary benefit of having `Clone` come from `Rc`, is that we know that all references are functionally identical, without having to look inside the definition of the `LightSensorHandler` struct to verify that all of the mutable data is shared across instances. A secondary benefit is that we can remove `Rc` from the fields of the struct, and thereby reduce the number of places we might have to look to find cycles in the object graph (if we run into memory bloat). Bug: None Test: fx test input_pipeline_lib_tests Change-Id: I944a7ef4bfb0f34c480a62341ba63ff88992a506 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/884200 Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com> Reviewed-by: Paul Faria <paulfaria@google.com> Reviewed-by: Caroline Liu <carolineliu@google.com> Fuchsia-Auto-Submit: Mukesh Agrawal <quiche@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.