summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharisee <chiw@google.com>2023-03-03 02:08:34 +0000
committerCharisee Chiw <chiw@google.com>2023-03-13 16:42:35 +0000
commitab53d0adc390ad0b13b98fcb5ef2c2dbbeb2bf97 (patch)
treedd64af59e6d957617e4cf4662b90dbf342d29a40
parent19ce0cba3e17c1a1ad4979d73a520872f0db4e04 (diff)
downloadnative-ab53d0adc390ad0b13b98fcb5ef2c2dbbeb2bf97.tar.gz
Change request for Rust v1.68.0
error: this `impl` can be derived --> frameworks/native/libs/binder/rust/src/binder.rs:113:1 | 113 | / impl Default for Stability { 114 | | fn default() -> Self { 115 | | Stability::Local 116 | | } 117 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls = note: `-D clippy::derivable-impls` implied by `-D warnings` = help: remove the manual implementation... help: ...and instead derive it... | 104 | #[derive(Default)] | help: ...and mark the default variant | 107 ~ #[default] 108 ~ Local, | bug: 270756468 Test: test_compiler.py Change-Id: Iafe539357b050069babf9a910dc3877a9bf2c75e
-rw-r--r--libs/binder/rust/src/binder.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/libs/binder/rust/src/binder.rs b/libs/binder/rust/src/binder.rs
index 976f54d36f..d0e35de3f7 100644
--- a/libs/binder/rust/src/binder.rs
+++ b/libs/binder/rust/src/binder.rs
@@ -100,22 +100,17 @@ where
/// An interface can promise to be a stable vendor interface ([`Vintf`]), or
/// makes no stability guarantees ([`Local`]). [`Local`] is
/// currently the default stability.
-#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
+#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Default)]
pub enum Stability {
/// Default stability, visible to other modules in the same compilation
/// context (e.g. modules on system.img)
+ #[default]
Local,
/// A Vendor Interface Object, which promises to be stable
Vintf,
}
-impl Default for Stability {
- fn default() -> Self {
- Stability::Local
- }
-}
-
impl From<Stability> for i32 {
fn from(stability: Stability) -> i32 {
use Stability::*;