fix clippy suggestions
This commit is contained in:
@@ -33,7 +33,7 @@ impl Entry {
|
|||||||
|| !toPort.parse::<i32>().is_ok_and(|a| a > 1 && a < 65535)
|
|| !toPort.parse::<i32>().is_ok_and(|a| a > 1 && a < 65535)
|
||||||
{
|
{
|
||||||
Err(EntryCreation::PortValidationError)
|
Err(EntryCreation::PortValidationError)
|
||||||
} else if !ip.is_match(&fromIP.trim()) || !ip.is_match(&toIP.trim()) {
|
} else if !ip.is_match(fromIP.trim()) || !ip.is_match(toIP.trim()) {
|
||||||
Err(EntryCreation::IPValidationError)
|
Err(EntryCreation::IPValidationError)
|
||||||
} else {
|
} else {
|
||||||
Ok(Entry {
|
Ok(Entry {
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ impl AppState {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
outputString.push_str("\nwait");
|
outputString.push_str("\nwait");
|
||||||
std::fs::write("./forward.sh", outputString);
|
let _ = std::fs::write("./forward.sh", outputString);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn save(&self) {
|
pub fn save(&self) {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ pub fn ui(frame: &mut Frame, app: &AppState) {
|
|||||||
let mut currentItems = Vec::<ListItem>::new();
|
let mut currentItems = Vec::<ListItem>::new();
|
||||||
for (i, e) in app.entries.iter().enumerate() {
|
for (i, e) in app.entries.iter().enumerate() {
|
||||||
currentItems.push(ListItem::new(Line::from(Span::styled(
|
currentItems.push(ListItem::new(Line::from(Span::styled(
|
||||||
format!("{}. {}", i, e),
|
format!("{i}. {e}"),
|
||||||
Style::default().fg(Color::Yellow),
|
Style::default().fg(Color::Yellow),
|
||||||
))));
|
))));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user