Skip to content

Commit 21a4653

Browse files
committed
InputVerifier: put parameters into a struct
This makes it clearer which parameter is which when calling, and also allows us to make the tests much more succinct by using struct update syntax. Bug: 245989146 Test: $ atest --host libinput_rust_test Flag: EXEMPT refactor Change-Id: If68332d652186b7283435cbc41af78bf12aa5b94
1 parent 26640c9 commit 21a4653

3 files changed

Lines changed: 470 additions & 689 deletions

File tree

libs/input/rust/input.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub enum SourceClass {
5050

5151
bitflags! {
5252
/// Source of the input device or input events.
53-
#[derive(Debug, PartialEq)]
53+
#[derive(Clone, Copy, Debug, PartialEq)]
5454
pub struct Source: u32 {
5555
// Constants from SourceClass, added here for compatibility reasons
5656
/// SourceClass::Button
@@ -219,7 +219,7 @@ bitflags! {
219219
/// MotionEvent flags.
220220
/// The source of truth for the flag definitions are the MotionEventFlag AIDL enum.
221221
/// The flag values are redefined here as a bitflags API.
222-
#[derive(Debug)]
222+
#[derive(Clone, Copy, Debug)]
223223
pub struct MotionFlags: u32 {
224224
/// FLAG_WINDOW_IS_OBSCURED
225225
const WINDOW_IS_OBSCURED = MotionEventFlag::WINDOW_IS_OBSCURED.0 as u32;

0 commit comments

Comments
 (0)