Skip to content

Commit

Permalink
Use starts_with instead of slice comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
dns13 committed Mar 5, 2024
1 parent 304d926 commit 5d0cf57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ fn get_ipv6_link_local_from_serial(serial: u32) -> String {
let addrs = &itf.addr;
for addr in addrs.iter() {
if addr.ip().is_ipv6() && !addr.ip().is_loopback() {
if &addr.ip().to_string()[..6] == "fe80::" {
if addr.ip().to_string().starts_with("fe80::") {
interface = Some(itf.name.clone());
break;
}
Expand Down

0 comments on commit 5d0cf57

Please sign in to comment.