1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-24 00:48:53 +03:00

bindings: rust: remove useless clone

Reported by 1.74.0-nightly:

  warning: call to `.clone()` on a reference in this situation does nothing
    --> libgpiod/tests/line_request.rs:71:44
     |
  71 |             let chip_name = sim.chip_name().clone();
     |                                            ^^^^^^^^ help: remove this redundant call
     |
     = note: the type `str` does not implement `Clone`, so calling `clone` on `&str` copies the reference, which does not do anything and can be removed
     = note: `#[warn(noop_method_call)]` on by default

Signed-off-by: Erik Schilling <erik.schilling@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
Erik Schilling
2023-09-28 08:23:19 +02:00
committed by Bartosz Golaszewski
parent ced90e7921
commit 27afa47fcb

View File

@@ -68,7 +68,7 @@ mod line_request {
let arc = config.sim();
let sim = arc.lock().unwrap();
let chip_name = sim.chip_name().clone();
let chip_name = sim.chip_name();
assert_eq!(config.request().chip_name().unwrap(), chip_name);
}