Skip to content

Commit e7b35a0

Browse files
committed
ui: screens: use ips.first() instead of ips.get(0) to get main IP
This is a trick that cargo clippy has recently learned, which means we need it to make the CI pipeline succeed. Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
1 parent 5a3edce commit e7b35a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ui/screens/setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl ActivatableScreen for SetupScreen {
116116
spawn(async move {
117117
while let Some(ips) = ip_stream.next().await {
118118
connectivity_topic_task.modify(|prev| {
119-
let ip = ips.get(0).cloned();
119+
let ip = ips.first().cloned();
120120

121121
match (prev.unwrap(), ip) {
122122
(Connectivity::Nothing, Some(ip)) | (Connectivity::IpOnly(_), Some(ip)) => {

src/ui/screens/system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl ActivatableScreen for SystemScreen {
117117
display,
118118
row_anchor(3),
119119
Box::new(|ips: &Vec<String>| {
120-
let ip = ips.get(0).map(|s| s.as_str()).unwrap_or("-");
120+
let ip = ips.first().map(|s| s.as_str()).unwrap_or("-");
121121
format!("IP: {}", ip)
122122
}),
123123
)

0 commit comments

Comments
 (0)