Provides the correct C representations for the data structures.
For now it has a lot of code dupplication with apple.rs. These need
to be abstracted and shared keeping only PlatformSupport implementations
and C struct reprs.
enabling openbsd build via mod.rs
not enabling default route on loopback interfaces.
we check the gw address and if it is a loopback one we
don't add the ifindex in the default_route ones.
If the address is `""` then an available address is automatically
picked.
```
// Network#allocate_tcp_port
if listen_address.is_empty() {
// If listen address is empty, find us a port iteratively
let port = self.find_available_tcp_port(5150)?;
let ip_addrs = available_unspecified_addresses();
Ok((port, ip_addrs))
} else {
// ...
}
```
Here was the error.
```
❯ cargo clippy
Checking veilid-tools v0.2.5 (~/Developer/veilid/veilid-tools)
error: this `MutexGuard` is held across an `await` point
--> veilid-tools/src/tests/common/test_host_interface.rs:269:17
|
269 | let mut tick = tick_1.lock();
| ^^^^^^^^
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
note: these are all the `await` points this lock is held through
--> veilid-tools/src/tests/common/test_host_interface.rs:271:25
|
271 | sleep(1000).await;
| ^^^^^
...
274 | sleep(1000).await;
| ^^^^^
...
277 | sleep(1000).await;
| ^^^^^
...
280 | sleep(1000).await;
| ^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock
note: the lint level is defined here
--> veilid-tools/src/lib.rs:23:9
|
23 | #![deny(clippy::all)]
| ^^^^^^^^^^^
= note: `#[deny(clippy::await_holding_lock)]` implied by `#[deny(clippy::all)]`
error: could not compile `veilid-tools` (lib) due to previous error
```
Dart, as of version 2.1.1, has a linter rule called
'unnecessary_await_in_return', described as 'Avoid returning
an awaited expression when the expression type is assignable
to the function's return type'. This can be found at
https://dart.dev/tools/linter-rules/unnecessary_await_in_return
VSCode applied that linter rule automatically, and I am tired of
the warnings, so I'm submitting this. :)
Clippy also informed us that we can drop some of the clone calls.
```
❯ cargo clippy
Checking veilid-core v0.2.5 (~/Developer/veilid/veilid-core)
error: using `clone` on type `Target` which implements the `Copy` trait
--> veilid-core/src/storage_manager/record_store.rs:912:33
|
912 | target: w.target.clone(),
| ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `w.target`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
note: the lint level is defined here
--> veilid-core/src/lib.rs:25:9
|
25 | #![deny(clippy::all)]
| ^^^^^^^^^^^
= note: `#[deny(clippy::clone_on_copy)]` implied by `#[deny(clippy::all)]`
error: using `clone` on type `Target` which implements the `Copy` trait
--> veilid-core/src/storage_manager/watch_value.rs:199:21
|
199 | target.clone(),
| ^^^^^^^^^^^^^^ help: try removing the `clone` call: `target`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
error: using `clone` on type `Target` which implements the `Copy` trait
--> veilid-core/src/storage_manager/mod.rs:737:17
|
737 | vc.target.clone(),
| ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `vc.target`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
error: could not compile `veilid-core` (lib) due to 3 previous errors
```