diff --git a/prototypes/ptth_quic_client_gui/src/main.rs b/prototypes/ptth_quic_client_gui/src/main.rs index 077f60a..4dba9b9 100644 --- a/prototypes/ptth_quic_client_gui/src/main.rs +++ b/prototypes/ptth_quic_client_gui/src/main.rs @@ -136,7 +136,9 @@ impl GuiClient <'_> { ports_col: &mut Flex, fltk_tx: fltk::app::Sender ) { - if self.ports.len () >= 5 { + const MAX_PORTS: usize = 5; + + if self.ports.len () >= MAX_PORTS { return; } @@ -151,7 +153,7 @@ impl GuiClient <'_> { self.ports.push (port); - if self.ports.len () >= 5 { + if self.ports.len () >= MAX_PORTS { self.but_add_port.deactivate (); } }