From c1780230e9fdec456d5505f857b6643fa724a712 Mon Sep 17 00:00:00 2001 From: veeso Date: Sat, 6 Mar 2021 15:10:54 +0100 Subject: [PATCH] Changed Unumber and Number names --- src/ui/layout/components/file_list.rs | 4 ++-- src/ui/layout/components/input.rs | 6 +++--- src/ui/layout/mod.rs | 4 ++-- src/ui/layout/props.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ui/layout/components/file_list.rs b/src/ui/layout/components/file_list.rs index efe5aa0..27293ff 100644 --- a/src/ui/layout/components/file_list.rs +++ b/src/ui/layout/components/file_list.rs @@ -254,7 +254,7 @@ impl Component for FileList { /// /// Return component value. File list return index fn get_value(&self) -> Payload { - Payload::Unumber(self.states.get_list_index()) + Payload::Unsigned(self.states.get_list_index()) } // -- events @@ -366,7 +366,7 @@ mod tests { // Enter assert_eq!( component.on(InputEvent::Key(KeyEvent::from(KeyCode::Enter))), - Msg::OnSubmit(Payload::Unumber(0)) + Msg::OnSubmit(Payload::Unsigned(0)) ); // On key assert_eq!( diff --git a/src/ui/layout/components/input.rs b/src/ui/layout/components/input.rs index 3d3a3d6..265a34d 100644 --- a/src/ui/layout/components/input.rs +++ b/src/ui/layout/components/input.rs @@ -61,7 +61,7 @@ impl OwnStates { /// Append, if possible according to input type, the character to the input vec pub fn append(&mut self, ch: char, itype: InputType) { match itype { - InputType::Number => { + InputType::Signed => { if ch.is_digit(10) { // Must be digit self.input.push(ch); @@ -269,8 +269,8 @@ impl Component for Input { /// Returns the value as string or as a number based on the input value fn get_value(&self) -> Payload { match self.props.input_type { - InputType::Number => { - Payload::Unumber(self.states.get_value().parse::().ok().unwrap_or(0)) + InputType::Signed => { + Payload::Unsigned(self.states.get_value().parse::().ok().unwrap_or(0)) } _ => Payload::Text(self.states.get_value()), } diff --git a/src/ui/layout/mod.rs b/src/ui/layout/mod.rs index cf2d224..6c55df4 100644 --- a/src/ui/layout/mod.rs +++ b/src/ui/layout/mod.rs @@ -53,8 +53,8 @@ pub enum Msg { #[derive(std::fmt::Debug, PartialEq)] pub enum Payload { Text(String), - Number(isize), - Unumber(usize), + Signed(isize), + Unsigned(usize), None, } diff --git a/src/ui/layout/props.rs b/src/ui/layout/props.rs index b7662ac..e222890 100644 --- a/src/ui/layout/props.rs +++ b/src/ui/layout/props.rs @@ -282,7 +282,7 @@ pub enum PropValue { #[derive(Clone, Copy, PartialEq, std::fmt::Debug)] pub enum InputType { Text, - Number, + Signed, Password, }