Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipam, network: implement IPAM management #862

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

ipam, network: implement IPAM management

b4aadac
Select commit
Loading
Failed to load commit list.
Draft

ipam, network: implement IPAM management #862

ipam, network: implement IPAM management
b4aadac
Select commit
Loading
Failed to load commit list.
Cirrus CI / validate_aarch64 failed Dec 6, 2023 in 4m 33s

Task Summary

Instruction main failed in 01:37

Details

✅ 00:02 clone
✅ 00:11 cargo
✅ 02:15 targets
✅ 00:05 bin
✅ 00:17 setup
❌ 01:37 main

help: remove `return`
    |
151 -             return conn.execute("DELETE FROM ipam WHERE ip = ?1", [ip.octets()]);
151 +             conn.execute("DELETE FROM ipam WHERE ip = ?1", [ip.octets()])
    |

error: unneeded `return` statement
   --> src/ipam/store.rs:188:5
    |
188 |     return Ok(result);
    |     ^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
    |
188 -     return Ok(result);
188 +     Ok(result)
    |

error: unneeded late initialization
   --> src/ipam/store.rs:168:9
    |
168 |         let ipaddr: IpAddr;
    |         ^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `ipaddr` here
    |
169 |         let ipaddr: IpAddr = if ip_raw.len() == 4 {
    |         ++++++++++++++++++++
help: remove the assignments from the branches
    |
170 ~             IpAddr::from(<Vec<u8> as TryInto<[u8; 4]>>::try_into(ip_raw).unwrap())
171 |         } else {
172 ~             IpAddr::from(<Vec<u8> as TryInto<[u8; 16]>>::try_into(ip_raw).unwrap())
    |
help: add a semicolon after the `if` expression
    |
173 |         };
    |          +

error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
   --> src/ipam/store.rs:183:9
    |
183 | /         match entry {
184 | |             Ok(entry) => result.push(entry),
185 | |             _ => {}
186 | |         }
    | |_________^ help: try: `if let Ok(entry) = entry { result.push(entry) }`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match

error: could not compile `netavark` (lib) due to 17 previous errors
make: *** [Makefile:133: validate] Error 101

Exit status: 2