Update deps, remove devcontainer, fix lints

This commit is contained in:
Dennis Schwerdel 2024-03-18 22:08:21 +01:00
parent 06f3d3c761
commit 18e4a22210
7 changed files with 226 additions and 377 deletions

View File

@ -1,18 +0,0 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/rust/.devcontainer/base.Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/rust:1
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends asciidoctor
RUN rm /etc/localtime && ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN chown vscode: -R /usr/local/rustup /usr/local/cargo
USER vscode
RUN rustup default 1.73.0 \
&& rustup component add clippy rust-src rustfmt
RUN cargo install cargo-outdated cargo-cache cargo-criterion \
&& cargo cache -a

View File

@ -1,41 +0,0 @@
{
"name": "Rust",
"build": {
"dockerfile": "Dockerfile"
},
"runArgs": [
"--cap-add=SYS_PTRACE",
"--security-opt",
"seccomp=unconfined"
],
// Add the IDs of extensions you want installed when the container is created.
// Set *default* container specific settings.json values on container create.
"customizations": {
"vscode": {
"terminal.integrated.shell.linux": "/bin/bash",
"lldb.executable": "/usr/bin/lldb",
// VS Code don't watch files under ./target
"files.watcherExclude": {
"**/target/**": true
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"bungcip.better-toml",
"vadimcn.vscode-lldb",
"serayuzgur.crates",
"editorconfig.editorconfig",
"swellaby.vscode-rust-test-adapter",
"matklad.rust-analyzer",
"asciidoctor.asciidoctor-vscode",
"ms-vscode.test-adapter-converter"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "rustc --version",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

View File

@ -4,7 +4,7 @@ This project follows [semantic versioning](http://semver.org).
### UNRELEASED
- [changed] Changed Rust version to 1.73.0
- [changed] Changed Rust version to 1.75.0
- [changed] Updated dependencies
- [fixed] Fix error when IPv6 is not available

526
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,7 @@ readme = "README.md"
edition = "2018"
[package.metadata]
toolchain = "1.73.0"
toolchain = "1.75.0"
upx_version = "3.96"
[dependencies]
@ -27,14 +27,13 @@ rand = "0.8"
fnv = "1"
yaml-rust = "0.4"
daemonize = "0.5"
#ring = "0.17"
ring = { git = "https://github.com/briansmith/ring", rev = "2afc921" } # https://github.com/briansmith/ring/issues/1707
ring = "0.17"
privdrop = "0.5"
byteorder = "1.4"
thiserror = "1.0"
smallvec = "1.7"
dialoguer = { version = "0.11", optional = true }
tungstenite = { version = "0.20", optional = true }
tungstenite = { version = "0.21", optional = true }
url = { version = "2.2", optional = true }
igd = { version = "0.12", optional = true }

View File

@ -18,7 +18,6 @@ pub use crate::{
device::{MockDevice, Type},
net::MockSocket,
payload::{Frame, Packet, Protocol},
types::Range,
util::{MockTimeSource, Time, TimeSource},
};

View File

@ -82,25 +82,25 @@ impl TrafficStats {
#[inline]
pub fn count_out_traffic(&mut self, peer: SocketAddr, bytes: usize) {
// HOT PATH
self.peers.entry(peer).or_insert_with(TrafficEntry::default).count_out(bytes);
self.peers.entry(peer).or_default().count_out(bytes);
}
#[inline]
pub fn count_in_traffic(&mut self, peer: SocketAddr, bytes: usize) {
// HOT PATH
self.peers.entry(peer).or_insert_with(TrafficEntry::default).count_in(bytes);
self.peers.entry(peer).or_default().count_in(bytes);
}
#[inline]
pub fn count_out_payload(&mut self, remote: Address, local: Address, bytes: usize) {
// HOT PATH
self.payload.entry((remote, local)).or_insert_with(TrafficEntry::default).count_out(bytes);
self.payload.entry((remote, local)).or_default().count_out(bytes);
}
#[inline]
pub fn count_in_payload(&mut self, remote: Address, local: Address, bytes: usize) {
// HOT PATH
self.payload.entry((remote, local)).or_insert_with(TrafficEntry::default).count_in(bytes);
self.payload.entry((remote, local)).or_default().count_in(bytes);
}
pub fn count_invalid_protocol(&mut self, bytes: usize) {