Skip to content

Commit 4491709

Browse files
fix: satisfy clippy for build script changes
1 parent c887c00 commit 4491709

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const WINDOWS_ICON_PATH: &str = "./resources/packaging/windows/graphics/sniffnet
1212
const SERVICES_LIST_PATH: &str = "./services.txt";
1313

1414
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
15+
#[allow(clippy::upper_case_acronyms)]
1516
enum BuildProtocol {
1617
TCP,
1718
UDP,

src/gui/pages/initial_page.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -309,21 +309,6 @@ fn format_packet_count(value: u128) -> String {
309309
}
310310
}
311311

312-
#[cfg(test)]
313-
mod tests {
314-
use super::format_packet_count;
315-
316-
#[test]
317-
fn test_format_packet_count() {
318-
assert_eq!(format_packet_count(0), "0");
319-
assert_eq!(format_packet_count(999), "999");
320-
assert_eq!(format_packet_count(1_500), "1.5K");
321-
assert_eq!(format_packet_count(999_999), "999K");
322-
assert_eq!(format_packet_count(1_200_000), "1.2M");
323-
assert_eq!(format_packet_count(123_000_000_000), "123G");
324-
}
325-
}
326-
327312
pub(crate) fn get_addresses_row(
328313
link_type: MyLinkType,
329314
addresses: &Vec<Address>,
@@ -509,3 +494,18 @@ fn get_export_pcap_group_maybe<'a>(
509494
.class(ContainerType::BorderedRound),
510495
)
511496
}
497+
498+
#[cfg(test)]
499+
mod tests {
500+
use super::format_packet_count;
501+
502+
#[test]
503+
fn test_format_packet_count() {
504+
assert_eq!(format_packet_count(0), "0");
505+
assert_eq!(format_packet_count(999), "999");
506+
assert_eq!(format_packet_count(1_500), "1.5K");
507+
assert_eq!(format_packet_count(999_999), "999K");
508+
assert_eq!(format_packet_count(1_200_000), "1.2M");
509+
assert_eq!(format_packet_count(123_000_000_000), "123G");
510+
}
511+
}

0 commit comments

Comments
 (0)