replace itertools with just either
All checks were successful
CI / checks (push) Successful in 37s

This commit is contained in:
Robin Appelman 2025-05-23 22:13:50 +02:00
commit e0fa41e29d
3 changed files with 6 additions and 15 deletions

15
Cargo.lock generated
View file

@ -16,9 +16,9 @@ checksum = "9ac26892eaac40bd0a28b3a1ea93da165ef30f8ffbc3ac6fea430daf7091de58"
[[package]]
name = "either"
version = "1.13.0"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
name = "fnv"
@ -43,15 +43,6 @@ version = "2.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708"
[[package]]
name = "itertools"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
dependencies = [
"either",
]
[[package]]
name = "itoa"
version = "1.0.14"
@ -63,9 +54,9 @@ name = "real-ip"
version = "0.1.0"
dependencies = [
"comma-separated",
"either",
"http",
"ipnet",
"itertools",
"rfc7239",
]

View file

@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
repository = "https://codeberg.org/icewind/real-ip"
license = "MIT OR Apache-2.0"
rust-version = "1.60.0"
rust-version = "1.63.0"
description = "Get the \"real ip\" of an incoming request using the \"forwarded\", \"x-forwarded-for\" or \"x-real-ip\" headers set by reverse proxies."
[dependencies]
@ -12,4 +12,4 @@ http = "1.1.0"
rfc7239 = "0.1.2"
comma-separated = "0.1.0"
ipnet = "2.10.1"
itertools = "0.13.0"
either = "1.15.0"

View file

@ -58,9 +58,9 @@ pub mod headers;
use crate::headers::{
extract_forwarded_header, extract_real_ip_header, extract_x_forwarded_for_header,
};
use either::Either;
use http::HeaderMap;
pub use ipnet::IpNet;
use itertools::Either;
use std::iter::{empty, once};
use std::net::IpAddr;