diff --git a/rust/src/input.rs b/rust/src/input.rs index e936d044b..fe24d7b2e 100644 --- a/rust/src/input.rs +++ b/rust/src/input.rs @@ -15,7 +15,7 @@ use nc::types::Input; /// comparison for equality (excepting seqnum). /// /// Returns true if the two are data-equivalent. -pub fn ncinput_equal_p(input1: Input, input2: Input) -> bool { +pub fn ncinput_equal_p(n1: Input, n2: Input) -> bool { if n1.id != n2.id { return false; } @@ -25,3 +25,31 @@ pub fn ncinput_equal_p(input1: Input, input2: Input) -> bool { // do not check seqnum true } + +impl Input { + pub fn new() -> Input { + Input { + id: 0, + y: 0, + x: 0, + alt: false, + shift: false, + ctrl: false, + seqnum: 0, + } + } +} + +/* +#[cfg(test)] +mod test { + use super::nc; + use serial_test::serial; + + #[test] + #[serial] + fn ncinput_equal_p() { + assert!(); + } +} +*/ diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 65463495e..aed71ba13 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -18,25 +18,27 @@ mod macros; mod cells; mod channel; mod direct; +mod input; mod key; mod keycodes; mod nc; mod palette; mod pixel; mod plane; -mod visual; mod types; +mod visual; pub use cells::*; pub use channel::*; pub use direct::*; +pub use input::*; pub use key::*; pub use keycodes::*; pub use nc::*; pub use palette::*; pub use pixel::*; pub use plane::*; -pub use visual::*; pub use types::*; +pub use visual::*; // TODO: move tests out #[cfg(test)]