wip: improve bandwidth limiting #24
Annotations
107 warnings
|
[clippy] src/config.rs#L20:
src/config.rs#L20
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
--> src/config.rs:20:5
|
20 | / pub fn from_str(s: &str) -> Result<Self> {
21 | | match s.to_lowercase().as_str() {
22 | | "tcp" => Ok(Protocol::Tcp),
23 | | "udp" => Ok(Protocol::Udp),
... |
30 | | }
| |_____^
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
|
[clippy] src/config.rs#L186:
src/config.rs#L186
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:186:16
|
186 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
|
|
[clippy] src/config.rs#L195:
src/config.rs#L195
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:195:16
|
195 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#manual_range_contains
|
|
[clippy] src/config.rs#L390:
src/config.rs#L390
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/config.rs:390:35
|
390 | fn validate_ingress_list(ingress: &Vec<String>) -> Result<(), ValidationError> {
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
|
[clippy] src/wireguard.rs#L104:
src/wireguard.rs#L104
warning: useless conversion to the same type: `std::net::Ipv4Addr`
--> src/wireguard.rs:104:31
|
104 | let ip_addr = Ipv4Addr::from(sock_addr.ip());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Ipv4Addr::from()`: `sock_addr.ip()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
|
[clippy] src/wireguard.rs#L178:
src/wireguard.rs#L178
warning: this function has too many arguments (9/7)
--> src/wireguard.rs:178:5
|
178 | / pub async fn setup(
179 | | origin_keys: WireGuardKeys,
180 | | proxy_public_key: String,
181 | | proxy_endpoint: String,
... |
187 | | download_limit: Option<u32>, // Download limit in Mbps (proxy -> origin)
188 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
|
[clippy] src/wireguard.rs#L224:
src/wireguard.rs#L224
warning: useless use of `format!`
--> src/wireguard.rs:224:32
|
224 | post_up_rules.push(format!("tc qdisc add dev wg0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
[clippy] src/wireguard.rs#L233:
src/wireguard.rs#L233
warning: useless use of `format!`
--> src/wireguard.rs:233:33
|
233 | pre_down_rules.push(format!("tc qdisc del dev wg0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L244:
src/wireguard.rs#L244
warning: useless use of `format!`
--> src/wireguard.rs:244:32
|
244 | post_up_rules.push(format!("modprobe ifb numifbs=1"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"modprobe ifb numifbs=1".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L245:
src/wireguard.rs#L245
warning: useless use of `format!`
--> src/wireguard.rs:245:32
|
245 | post_up_rules.push(format!("ip link set dev ifb0 up"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 up".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L248:
src/wireguard.rs#L248
warning: useless use of `format!`
--> src/wireguard.rs:248:32
|
248 | post_up_rules.push(format!("tc qdisc add dev wg0 handle ffff: ingress"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 handle ffff: ingress".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L249:
src/wireguard.rs#L249
warning: useless use of `format!`
--> src/wireguard.rs:249:32
|
249 | post_up_rules.push(format!(
| ________________________________^
250 | | "tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0"
251 | | ));
| |_____________^ help: consider using `.to_string()`: `"tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L254:
src/wireguard.rs#L254
warning: useless use of `format!`
--> src/wireguard.rs:254:32
|
254 | post_up_rules.push(format!("tc qdisc add dev ifb0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev ifb0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L261:
src/wireguard.rs#L261
warning: useless use of `format!`
--> src/wireguard.rs:261:33
|
261 | pre_down_rules.push(format!("tc qdisc del dev wg0 ingress || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 ingress || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L262:
src/wireguard.rs#L262
warning: useless use of `format!`
--> src/wireguard.rs:262:33
|
262 | pre_down_rules.push(format!("tc qdisc del dev ifb0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev ifb0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L263:
src/wireguard.rs#L263
warning: useless use of `format!`
--> src/wireguard.rs:263:33
|
263 | pre_down_rules.push(format!("ip link set dev ifb0 down || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 down || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L267:
src/wireguard.rs#L267
warning: useless use of `format!`
--> src/wireguard.rs:267:28
|
267 | post_up_rules.push(format!("iptables -N OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -N OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L268:
src/wireguard.rs#L268
warning: useless use of `format!`
--> src/wireguard.rs:268:29
|
268 | pre_down_rules.push(format!("iptables -F OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -F OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L269:
src/wireguard.rs#L269
warning: useless use of `format!`
--> src/wireguard.rs:269:29
|
269 | pre_down_rules.push(format!("iptables -X OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -X OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L335:
src/wireguard.rs#L335
warning: useless use of `format!`
--> src/wireguard.rs:335:28
|
335 | post_up_rules.push(format!("iptables -A FORWARD -j OUTPOST_ACCOUNTING"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -A FORWARD -j OUTPOST_ACCOUNTING".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L336:
src/wireguard.rs#L336
warning: useless use of `format!`
--> src/wireguard.rs:336:29
|
336 | pre_down_rules.push(format!("iptables -D FORWARD -j OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -D FORWARD -j OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/aws/cloudformation.rs#L387:
src/aws/cloudformation.rs#L387
warning: manual implementation of `rsplit_once`
--> src/aws/cloudformation.rs:387:22
|
387 | let subnet = self
| ______________________^
388 | | .wg_proxy_ip
389 | | .rsplitn(2, '.')
390 | | .nth(1)
| |___________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#manual_split_once
= note: `#[warn(clippy::manual_split_once)]` on by default
help: try
|
387 ~ let subnet = self
388 + .wg_proxy_ip.rsplit_once('.').map(|x| x.0)
|
|
|
[clippy] src/aws/mod.rs#L142:
src/aws/mod.rs#L142
warning: this function has too many arguments (18/7)
--> src/aws/mod.rs:142:5
|
142 | / pub async fn deploy(
143 | | ingress_host: String,
144 | | ingress_port: u16,
145 | | ingress_protocol: String,
... |
160 | | port_mappings: Vec<(u16, String)>,
161 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#too_many_arguments
|
|
[clippy] src/aws/mod.rs#L355:
src/aws/mod.rs#L355
warning: this `map_or` can be simplified
--> src/aws/mod.rs:355:41
|
355 | / ... e.logical_resource_id()
356 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#unnecessary_map_or
= note: `#[warn(clippy::unnecessary_map_or)]` on by default
help: use is_some_and instead
|
356 - .map_or(false, |id| id != self.stack_name)
356 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/aws/mod.rs#L554:
src/aws/mod.rs#L554
warning: this `map_or` can be simplified
--> src/aws/mod.rs:554:49
|
554 | / ... e.logical_resource_id()
555 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#unnecessary_map_or
help: use is_some_and instead
|
555 - .map_or(false, |id| id != self.stack_name)
555 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/config.rs#L20:
src/config.rs#L20
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
--> src/config.rs:20:5
|
20 | / pub fn from_str(s: &str) -> Result<Self> {
21 | | match s.to_lowercase().as_str() {
22 | | "tcp" => Ok(Protocol::Tcp),
23 | | "udp" => Ok(Protocol::Udp),
... |
30 | | }
| |_____^
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
|
[clippy] src/config.rs#L186:
src/config.rs#L186
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:186:16
|
186 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
|
|
[clippy] src/config.rs#L195:
src/config.rs#L195
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:195:16
|
195 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#manual_range_contains
|
|
[clippy] src/config.rs#L390:
src/config.rs#L390
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/config.rs:390:35
|
390 | fn validate_ingress_list(ingress: &Vec<String>) -> Result<(), ValidationError> {
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
|
[clippy] src/wireguard.rs#L104:
src/wireguard.rs#L104
warning: useless conversion to the same type: `std::net::Ipv4Addr`
--> src/wireguard.rs:104:31
|
104 | let ip_addr = Ipv4Addr::from(sock_addr.ip());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Ipv4Addr::from()`: `sock_addr.ip()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
|
[clippy] src/wireguard.rs#L178:
src/wireguard.rs#L178
warning: this function has too many arguments (9/7)
--> src/wireguard.rs:178:5
|
178 | / pub async fn setup(
179 | | origin_keys: WireGuardKeys,
180 | | proxy_public_key: String,
181 | | proxy_endpoint: String,
... |
187 | | download_limit: Option<u32>, // Download limit in Mbps (proxy -> origin)
188 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
|
[clippy] src/wireguard.rs#L224:
src/wireguard.rs#L224
warning: useless use of `format!`
--> src/wireguard.rs:224:32
|
224 | post_up_rules.push(format!("tc qdisc add dev wg0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
[clippy] src/wireguard.rs#L233:
src/wireguard.rs#L233
warning: useless use of `format!`
--> src/wireguard.rs:233:33
|
233 | pre_down_rules.push(format!("tc qdisc del dev wg0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L244:
src/wireguard.rs#L244
warning: useless use of `format!`
--> src/wireguard.rs:244:32
|
244 | post_up_rules.push(format!("modprobe ifb numifbs=1"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"modprobe ifb numifbs=1".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L245:
src/wireguard.rs#L245
warning: useless use of `format!`
--> src/wireguard.rs:245:32
|
245 | post_up_rules.push(format!("ip link set dev ifb0 up"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 up".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L248:
src/wireguard.rs#L248
warning: useless use of `format!`
--> src/wireguard.rs:248:32
|
248 | post_up_rules.push(format!("tc qdisc add dev wg0 handle ffff: ingress"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 handle ffff: ingress".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L249:
src/wireguard.rs#L249
warning: useless use of `format!`
--> src/wireguard.rs:249:32
|
249 | post_up_rules.push(format!(
| ________________________________^
250 | | "tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0"
251 | | ));
| |_____________^ help: consider using `.to_string()`: `"tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L254:
src/wireguard.rs#L254
warning: useless use of `format!`
--> src/wireguard.rs:254:32
|
254 | post_up_rules.push(format!("tc qdisc add dev ifb0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev ifb0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L261:
src/wireguard.rs#L261
warning: useless use of `format!`
--> src/wireguard.rs:261:33
|
261 | pre_down_rules.push(format!("tc qdisc del dev wg0 ingress || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 ingress || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L262:
src/wireguard.rs#L262
warning: useless use of `format!`
--> src/wireguard.rs:262:33
|
262 | pre_down_rules.push(format!("tc qdisc del dev ifb0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev ifb0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L263:
src/wireguard.rs#L263
warning: useless use of `format!`
--> src/wireguard.rs:263:33
|
263 | pre_down_rules.push(format!("ip link set dev ifb0 down || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 down || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L267:
src/wireguard.rs#L267
warning: useless use of `format!`
--> src/wireguard.rs:267:28
|
267 | post_up_rules.push(format!("iptables -N OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -N OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L268:
src/wireguard.rs#L268
warning: useless use of `format!`
--> src/wireguard.rs:268:29
|
268 | pre_down_rules.push(format!("iptables -F OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -F OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L269:
src/wireguard.rs#L269
warning: useless use of `format!`
--> src/wireguard.rs:269:29
|
269 | pre_down_rules.push(format!("iptables -X OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -X OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L335:
src/wireguard.rs#L335
warning: useless use of `format!`
--> src/wireguard.rs:335:28
|
335 | post_up_rules.push(format!("iptables -A FORWARD -j OUTPOST_ACCOUNTING"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -A FORWARD -j OUTPOST_ACCOUNTING".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L336:
src/wireguard.rs#L336
warning: useless use of `format!`
--> src/wireguard.rs:336:29
|
336 | pre_down_rules.push(format!("iptables -D FORWARD -j OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -D FORWARD -j OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#useless_format
|
|
[clippy] src/aws/cloudformation.rs#L387:
src/aws/cloudformation.rs#L387
warning: manual implementation of `rsplit_once`
--> src/aws/cloudformation.rs:387:22
|
387 | let subnet = self
| ______________________^
388 | | .wg_proxy_ip
389 | | .rsplitn(2, '.')
390 | | .nth(1)
| |___________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#manual_split_once
= note: `#[warn(clippy::manual_split_once)]` on by default
help: try
|
387 ~ let subnet = self
388 + .wg_proxy_ip.rsplit_once('.').map(|x| x.0)
|
|
|
[clippy] src/aws/mod.rs#L142:
src/aws/mod.rs#L142
warning: this function has too many arguments (18/7)
--> src/aws/mod.rs:142:5
|
142 | / pub async fn deploy(
143 | | ingress_host: String,
144 | | ingress_port: u16,
145 | | ingress_protocol: String,
... |
160 | | port_mappings: Vec<(u16, String)>,
161 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#too_many_arguments
|
|
[clippy] src/aws/mod.rs#L355:
src/aws/mod.rs#L355
warning: this `map_or` can be simplified
--> src/aws/mod.rs:355:41
|
355 | / ... e.logical_resource_id()
356 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#unnecessary_map_or
= note: `#[warn(clippy::unnecessary_map_or)]` on by default
help: use is_some_and instead
|
356 - .map_or(false, |id| id != self.stack_name)
356 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/aws/mod.rs#L554:
src/aws/mod.rs#L554
warning: this `map_or` can be simplified
--> src/aws/mod.rs:554:49
|
554 | / ... e.logical_resource_id()
555 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#unnecessary_map_or
help: use is_some_and instead
|
555 - .map_or(false, |id| id != self.stack_name)
555 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/config.rs#L20:
src/config.rs#L20
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
--> src/config.rs:20:5
|
20 | / pub fn from_str(s: &str) -> Result<Self> {
21 | | match s.to_lowercase().as_str() {
22 | | "tcp" => Ok(Protocol::Tcp),
23 | | "udp" => Ok(Protocol::Udp),
... |
30 | | }
| |_____^
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
|
[clippy] src/config.rs#L186:
src/config.rs#L186
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:186:16
|
186 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
|
|
[clippy] src/config.rs#L195:
src/config.rs#L195
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:195:16
|
195 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#manual_range_contains
|
|
[clippy] src/config.rs#L390:
src/config.rs#L390
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/config.rs:390:35
|
390 | fn validate_ingress_list(ingress: &Vec<String>) -> Result<(), ValidationError> {
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
|
[clippy] src/wireguard.rs#L104:
src/wireguard.rs#L104
warning: useless conversion to the same type: `std::net::Ipv4Addr`
--> src/wireguard.rs:104:31
|
104 | let ip_addr = Ipv4Addr::from(sock_addr.ip());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Ipv4Addr::from()`: `sock_addr.ip()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
|
[clippy] src/wireguard.rs#L178:
src/wireguard.rs#L178
warning: this function has too many arguments (9/7)
--> src/wireguard.rs:178:5
|
178 | / pub async fn setup(
179 | | origin_keys: WireGuardKeys,
180 | | proxy_public_key: String,
181 | | proxy_endpoint: String,
... |
187 | | download_limit: Option<u32>, // Download limit in Mbps (proxy -> origin)
188 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
|
[clippy] src/wireguard.rs#L224:
src/wireguard.rs#L224
warning: useless use of `format!`
--> src/wireguard.rs:224:32
|
224 | post_up_rules.push(format!("tc qdisc add dev wg0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
[clippy] src/wireguard.rs#L233:
src/wireguard.rs#L233
warning: useless use of `format!`
--> src/wireguard.rs:233:33
|
233 | pre_down_rules.push(format!("tc qdisc del dev wg0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L244:
src/wireguard.rs#L244
warning: useless use of `format!`
--> src/wireguard.rs:244:32
|
244 | post_up_rules.push(format!("modprobe ifb numifbs=1"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"modprobe ifb numifbs=1".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L245:
src/wireguard.rs#L245
warning: useless use of `format!`
--> src/wireguard.rs:245:32
|
245 | post_up_rules.push(format!("ip link set dev ifb0 up"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 up".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L248:
src/wireguard.rs#L248
warning: useless use of `format!`
--> src/wireguard.rs:248:32
|
248 | post_up_rules.push(format!("tc qdisc add dev wg0 handle ffff: ingress"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 handle ffff: ingress".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L249:
src/wireguard.rs#L249
warning: useless use of `format!`
--> src/wireguard.rs:249:32
|
249 | post_up_rules.push(format!(
| ________________________________^
250 | | "tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0"
251 | | ));
| |_____________^ help: consider using `.to_string()`: `"tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L254:
src/wireguard.rs#L254
warning: useless use of `format!`
--> src/wireguard.rs:254:32
|
254 | post_up_rules.push(format!("tc qdisc add dev ifb0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev ifb0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L261:
src/wireguard.rs#L261
warning: useless use of `format!`
--> src/wireguard.rs:261:33
|
261 | pre_down_rules.push(format!("tc qdisc del dev wg0 ingress || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 ingress || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L262:
src/wireguard.rs#L262
warning: useless use of `format!`
--> src/wireguard.rs:262:33
|
262 | pre_down_rules.push(format!("tc qdisc del dev ifb0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev ifb0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L263:
src/wireguard.rs#L263
warning: useless use of `format!`
--> src/wireguard.rs:263:33
|
263 | pre_down_rules.push(format!("ip link set dev ifb0 down || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 down || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L267:
src/wireguard.rs#L267
warning: useless use of `format!`
--> src/wireguard.rs:267:28
|
267 | post_up_rules.push(format!("iptables -N OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -N OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L268:
src/wireguard.rs#L268
warning: useless use of `format!`
--> src/wireguard.rs:268:29
|
268 | pre_down_rules.push(format!("iptables -F OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -F OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L269:
src/wireguard.rs#L269
warning: useless use of `format!`
--> src/wireguard.rs:269:29
|
269 | pre_down_rules.push(format!("iptables -X OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -X OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L335:
src/wireguard.rs#L335
warning: useless use of `format!`
--> src/wireguard.rs:335:28
|
335 | post_up_rules.push(format!("iptables -A FORWARD -j OUTPOST_ACCOUNTING"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -A FORWARD -j OUTPOST_ACCOUNTING".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L336:
src/wireguard.rs#L336
warning: useless use of `format!`
--> src/wireguard.rs:336:29
|
336 | pre_down_rules.push(format!("iptables -D FORWARD -j OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -D FORWARD -j OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/aws/cloudformation.rs#L387:
src/aws/cloudformation.rs#L387
warning: manual implementation of `rsplit_once`
--> src/aws/cloudformation.rs:387:22
|
387 | let subnet = self
| ______________________^
388 | | .wg_proxy_ip
389 | | .rsplitn(2, '.')
390 | | .nth(1)
| |___________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#manual_split_once
= note: `#[warn(clippy::manual_split_once)]` on by default
help: try
|
387 ~ let subnet = self
388 + .wg_proxy_ip.rsplit_once('.').map(|x| x.0)
|
|
|
[clippy] src/aws/mod.rs#L142:
src/aws/mod.rs#L142
warning: this function has too many arguments (18/7)
--> src/aws/mod.rs:142:5
|
142 | / pub async fn deploy(
143 | | ingress_host: String,
144 | | ingress_port: u16,
145 | | ingress_protocol: String,
... |
160 | | port_mappings: Vec<(u16, String)>,
161 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#too_many_arguments
|
|
[clippy] src/aws/mod.rs#L355:
src/aws/mod.rs#L355
warning: this `map_or` can be simplified
--> src/aws/mod.rs:355:41
|
355 | / ... e.logical_resource_id()
356 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unnecessary_map_or
= note: `#[warn(clippy::unnecessary_map_or)]` on by default
help: use is_some_and instead
|
356 - .map_or(false, |id| id != self.stack_name)
356 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/aws/mod.rs#L554:
src/aws/mod.rs#L554
warning: this `map_or` can be simplified
--> src/aws/mod.rs:554:49
|
554 | / ... e.logical_resource_id()
555 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unnecessary_map_or
help: use is_some_and instead
|
555 - .map_or(false, |id| id != self.stack_name)
555 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/main.rs#L458:
src/main.rs#L458
warning: unused variable: `state`
--> src/main.rs:458:13
|
458 | let state = crate::api::AppState {
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_state`
|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
|
|
[clippy] src/main.rs#L463:
src/main.rs#L463
warning: unused variable: `app`
--> src/main.rs:463:13
|
463 | let app = crate::api::router(state);
| ^^^ help: if this is intentional, prefix it with an underscore: `_app`
|
|
[clippy] src/main.rs#L465:
src/main.rs#L465
warning: unused variable: `listener`
--> src/main.rs:465:13
|
465 | let listener = TcpListener::bind("0.0.0.0:3000").await?;
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_listener`
|
|
[clippy] src/main.rs#L465:
src/main.rs#L465
warning: unused variable: `val`
--> src/main.rs:465:24
|
465 | let listener = TcpListener::bind("0.0.0.0:3000").await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_val`
|
|
[clippy] src/main.rs#L466:
src/main.rs#L466
warning: unused variable: `val`
--> src/main.rs:466:9
|
466 | axum::serve(listener, app).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_val`
|
|
[clippy] src/main.rs#L100:
src/main.rs#L100
warning: called `unwrap` on `upload_limit` after checking its variant with `is_some`
--> src/main.rs:100:48
|
99 | if upload_limit.is_some() {
| ------------------------- help: try: `if let Some(<item>) = upload_limit`
100 | info!(" - Upload limit: {} Mbps", upload_limit.unwrap());
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unnecessary_unwrap
= note: `#[warn(clippy::unnecessary_unwrap)]` on by default
|
|
[clippy] src/main.rs#L103:
src/main.rs#L103
warning: called `unwrap` on `download_limit` after checking its variant with `is_some`
--> src/main.rs:103:50
|
102 | if download_limit.is_some() {
| --------------------------- help: try: `if let Some(<item>) = download_limit`
103 | info!(" - Download limit: {} Mbps", download_limit.unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unnecessary_unwrap
|
|
[clippy] src/config.rs#L20:
src/config.rs#L20
warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str`
--> src/config.rs:20:5
|
20 | / pub fn from_str(s: &str) -> Result<Self> {
21 | | match s.to_lowercase().as_str() {
22 | | "tcp" => Ok(Protocol::Tcp),
23 | | "udp" => Ok(Protocol::Udp),
... |
30 | | }
| |_____^
|
= help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#should_implement_trait
= note: `#[warn(clippy::should_implement_trait)]` on by default
|
|
[clippy] src/config.rs#L186:
src/config.rs#L186
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:186:16
|
186 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#manual_range_contains
= note: `#[warn(clippy::manual_range_contains)]` on by default
|
|
[clippy] src/config.rs#L195:
src/config.rs#L195
warning: manual `!RangeInclusive::contains` implementation
--> src/config.rs:195:16
|
195 | if limit < 1 || limit > 10000 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=10000).contains(&limit)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#manual_range_contains
|
|
[clippy] src/config.rs#L390:
src/config.rs#L390
warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do
--> src/config.rs:390:35
|
390 | fn validate_ingress_list(ingress: &Vec<String>) -> Result<(), ValidationError> {
| ^^^^^^^^^^^^ help: change this to: `&[String]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
|
[clippy] src/wireguard.rs#L104:
src/wireguard.rs#L104
warning: useless conversion to the same type: `std::net::Ipv4Addr`
--> src/wireguard.rs:104:31
|
104 | let ip_addr = Ipv4Addr::from(sock_addr.ip());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `Ipv4Addr::from()`: `sock_addr.ip()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
|
[clippy] src/wireguard.rs#L178:
src/wireguard.rs#L178
warning: this function has too many arguments (9/7)
--> src/wireguard.rs:178:5
|
178 | / pub async fn setup(
179 | | origin_keys: WireGuardKeys,
180 | | proxy_public_key: String,
181 | | proxy_endpoint: String,
... |
187 | | download_limit: Option<u32>, // Download limit in Mbps (proxy -> origin)
188 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
|
[clippy] src/wireguard.rs#L224:
src/wireguard.rs#L224
warning: useless use of `format!`
--> src/wireguard.rs:224:32
|
224 | post_up_rules.push(format!("tc qdisc add dev wg0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
|
|
[clippy] src/wireguard.rs#L233:
src/wireguard.rs#L233
warning: useless use of `format!`
--> src/wireguard.rs:233:33
|
233 | pre_down_rules.push(format!("tc qdisc del dev wg0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L244:
src/wireguard.rs#L244
warning: useless use of `format!`
--> src/wireguard.rs:244:32
|
244 | post_up_rules.push(format!("modprobe ifb numifbs=1"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"modprobe ifb numifbs=1".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L245:
src/wireguard.rs#L245
warning: useless use of `format!`
--> src/wireguard.rs:245:32
|
245 | post_up_rules.push(format!("ip link set dev ifb0 up"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 up".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L248:
src/wireguard.rs#L248
warning: useless use of `format!`
--> src/wireguard.rs:248:32
|
248 | post_up_rules.push(format!("tc qdisc add dev wg0 handle ffff: ingress"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev wg0 handle ffff: ingress".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L249:
src/wireguard.rs#L249
warning: useless use of `format!`
--> src/wireguard.rs:249:32
|
249 | post_up_rules.push(format!(
| ________________________________^
250 | | "tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0"
251 | | ));
| |_____________^ help: consider using `.to_string()`: `"tc filter add dev wg0 parent ffff: protocol all u32 match u32 0 0 action mirred egress redirect dev ifb0".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L254:
src/wireguard.rs#L254
warning: useless use of `format!`
--> src/wireguard.rs:254:32
|
254 | post_up_rules.push(format!("tc qdisc add dev ifb0 root handle 1: htb default 10"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc add dev ifb0 root handle 1: htb default 10".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L261:
src/wireguard.rs#L261
warning: useless use of `format!`
--> src/wireguard.rs:261:33
|
261 | pre_down_rules.push(format!("tc qdisc del dev wg0 ingress || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev wg0 ingress || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L262:
src/wireguard.rs#L262
warning: useless use of `format!`
--> src/wireguard.rs:262:33
|
262 | pre_down_rules.push(format!("tc qdisc del dev ifb0 root || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"tc qdisc del dev ifb0 root || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L263:
src/wireguard.rs#L263
warning: useless use of `format!`
--> src/wireguard.rs:263:33
|
263 | pre_down_rules.push(format!("ip link set dev ifb0 down || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ip link set dev ifb0 down || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L267:
src/wireguard.rs#L267
warning: useless use of `format!`
--> src/wireguard.rs:267:28
|
267 | post_up_rules.push(format!("iptables -N OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -N OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L268:
src/wireguard.rs#L268
warning: useless use of `format!`
--> src/wireguard.rs:268:29
|
268 | pre_down_rules.push(format!("iptables -F OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -F OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L269:
src/wireguard.rs#L269
warning: useless use of `format!`
--> src/wireguard.rs:269:29
|
269 | pre_down_rules.push(format!("iptables -X OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -X OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L335:
src/wireguard.rs#L335
warning: useless use of `format!`
--> src/wireguard.rs:335:28
|
335 | post_up_rules.push(format!("iptables -A FORWARD -j OUTPOST_ACCOUNTING"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -A FORWARD -j OUTPOST_ACCOUNTING".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/wireguard.rs#L336:
src/wireguard.rs#L336
warning: useless use of `format!`
--> src/wireguard.rs:336:29
|
336 | pre_down_rules.push(format!("iptables -D FORWARD -j OUTPOST_ACCOUNTING || true"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"iptables -D FORWARD -j OUTPOST_ACCOUNTING || true".to_string()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#useless_format
|
|
[clippy] src/aws/cloudformation.rs#L387:
src/aws/cloudformation.rs#L387
warning: manual implementation of `rsplit_once`
--> src/aws/cloudformation.rs:387:22
|
387 | let subnet = self
| ______________________^
388 | | .wg_proxy_ip
389 | | .rsplitn(2, '.')
390 | | .nth(1)
| |___________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#manual_split_once
= note: `#[warn(clippy::manual_split_once)]` on by default
help: try
|
387 ~ let subnet = self
388 + .wg_proxy_ip.rsplit_once('.').map(|x| x.0)
|
|
|
[clippy] src/aws/mod.rs#L142:
src/aws/mod.rs#L142
warning: this function has too many arguments (18/7)
--> src/aws/mod.rs:142:5
|
142 | / pub async fn deploy(
143 | | ingress_host: String,
144 | | ingress_port: u16,
145 | | ingress_protocol: String,
... |
160 | | port_mappings: Vec<(u16, String)>,
161 | | ) -> Result<Self> {
| |_____________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#too_many_arguments
|
|
[clippy] src/aws/mod.rs#L355:
src/aws/mod.rs#L355
warning: this `map_or` can be simplified
--> src/aws/mod.rs:355:41
|
355 | / ... e.logical_resource_id()
356 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unnecessary_map_or
= note: `#[warn(clippy::unnecessary_map_or)]` on by default
help: use is_some_and instead
|
356 - .map_or(false, |id| id != self.stack_name)
356 + .is_some_and(|id| id != self.stack_name)
|
|
|
[clippy] src/aws/mod.rs#L554:
src/aws/mod.rs#L554
warning: this `map_or` can be simplified
--> src/aws/mod.rs:554:49
|
554 | / ... e.logical_resource_id()
555 | | ... .map_or(false, |id| id != self.stack_name)
| |____________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#unnecessary_map_or
help: use is_some_and instead
|
555 - .map_or(false, |id| id != self.stack_name)
555 + .is_some_and(|id| id != self.stack_name)
|
|