From ef8c3b961dd5b2008bc616c34d1a764a460ef017 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 27 Nov 2024 21:16:27 +0100 Subject: [PATCH 01/10] flake --- .envrc | 1 + .github/workflows/ci.yaml | 17 ++++++ .github/workflows/rust.yml | 33 ------------ .gitignore | 5 +- Cargo.lock | 2 - Cargo.toml | 1 + README.md | 2 +- flake.lock | 107 +++++++++++++++++++++++++++++++++++++ flake.nix | 14 +++++ src/lib.rs | 2 +- 10 files changed, 146 insertions(+), 38 deletions(-) create mode 100644 .envrc create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/rust.yml create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..fb87a7a --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,17 @@ +name: "CI" +on: + pull_request: + push: + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v26 + - uses: icewind1991/attic-action@v1 + with: + name: ci + instance: https://cache.icewind.me + authToken: "${{ secrets.ATTIC_TOKEN }}" + - run: nix flake check --keep-going diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index e0aa2bf..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,33 +0,0 @@ -on: [push, pull_request] - -name: CI - -jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: check - - test: - runs-on: ubuntu-latest - name: Tests - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: test diff --git a/.gitignore b/.gitignore index ea8c4bf..442c7fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -/target +.idea +target +result +.direnv \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 51dba84..192d432 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,7 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - [[package]] name = "rfc7239" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index e337b14..9411eb0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,6 +7,7 @@ description = "Parser for rfc7239 formatted Forwarded headers" license = "MIT OR Apache-2.0" repository = "https://github.com/icewind1991/rfc7239" documentation = "https://docs.rs/rfc7239" +rust-version = "1.56.1" [dependencies] uncased = "0.9.10" diff --git a/README.md b/README.md index 8d35472..77d3d1f 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,4 @@ for node_result in parse(header_value) { } ``` -[rfc7239]: https://tools.ietf.org/html/rfc7239 \ No newline at end of file +[rfc7239]: https://tools.ietf.org/html/rfc7239 diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..c377800 --- /dev/null +++ b/flake.lock @@ -0,0 +1,107 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1730060262, + "narHash": "sha256-RMgSVkZ9H03sxC+Vh4jxtLTCzSjPq18UWpiM0gq6shQ=", + "owner": "ipetkov", + "repo": "crane", + "rev": "498d9f122c413ee1154e8131ace5a35a80d8fa76", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flakelight": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1732697024, + "narHash": "sha256-GcLauDQQI4xO4vy3e2QxPneR86FsJ1ubAbFDlTyEZ9s=", + "owner": "nix-community", + "repo": "flakelight", + "rev": "1af817b5987e78b7a260dff6d62793716b98d794", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flakelight", + "type": "github" + } + }, + "mill-scale": { + "inputs": { + "crane": "crane", + "flakelight": [ + "flakelight" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1732306573, + "narHash": "sha256-wE12kIIE0qb9V9y0JiVm5RsRrMNX+KeeMwkzwefdHhY=", + "owner": "icewind1991", + "repo": "mill-scale", + "rev": "8b4cbf174a9728d7e58bbfde5b5a6685dcbf1015", + "type": "github" + }, + "original": { + "owner": "icewind1991", + "repo": "mill-scale", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1732632634, + "narHash": "sha256-+G7n/ZD635aN0sEXQLynU7pWMd3PKDM7yBIXvYmjABQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6f6076c37180ea3a916f84928cf3a714c5207a30", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-24.05", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flakelight": "flakelight", + "mill-scale": "mill-scale", + "nixpkgs": "nixpkgs" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "mill-scale", + "flakelight", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1731897198, + "narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "0be641045af6d8666c11c2c40e45ffc9667839b5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4fffa0a --- /dev/null +++ b/flake.nix @@ -0,0 +1,14 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-24.05"; + flakelight = { + url = "github:nix-community/flakelight"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + mill-scale = { + url = "github:icewind1991/mill-scale"; + inputs.flakelight.follows = "flakelight"; + }; + }; + outputs = { mill-scale, ... }: mill-scale ./. { }; +} diff --git a/src/lib.rs b/src/lib.rs index a8195be..6389281 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -50,7 +50,7 @@ impl Display for RfcError { impl Error for RfcError {} /// Parse an rfc7239 header value into a list of forwarded nodes -pub fn parse(header_value: &str) -> impl Iterator> { +pub fn parse(header_value: &str) -> impl DoubleEndedIterator> { header_value.split(',').map(str::trim).map(Forwarded::parse) } From 42c9c2abd6190da2ebfb822f6a62806139163938 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 28 Nov 2024 22:25:27 +0100 Subject: [PATCH 02/10] 0.1.2 --- Cargo.lock | 4 +++- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 192d432..ecad56e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,8 +1,10 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "rfc7239" -version = "0.1.1" +version = "0.1.2" dependencies = [ "uncased", ] diff --git a/Cargo.toml b/Cargo.toml index 9411eb0..afe8928 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rfc7239" -version = "0.1.1" +version = "0.1.2" authors = ["Robin Appelman "] edition = "2018" description = "Parser for rfc7239 formatted Forwarded headers" From d06978a34a885f270e26a09857884e3030e4ff6e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 11 Dec 2024 21:49:01 +0100 Subject: [PATCH 03/10] make no_std compatible --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/lib.rs | 25 ++++++++++++++++--------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ecad56e..c5f69aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,7 +4,7 @@ version = 3 [[package]] name = "rfc7239" -version = "0.1.2" +version = "0.1.3" dependencies = [ "uncased", ] diff --git a/Cargo.toml b/Cargo.toml index afe8928..096c8f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rfc7239" -version = "0.1.2" +version = "0.1.3" authors = ["Robin Appelman "] edition = "2018" description = "Parser for rfc7239 formatted Forwarded headers" diff --git a/src/lib.rs b/src/lib.rs index 6389281..8a6ce50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,11 @@ +#![no_std] //! Parser for [rfc7239] formatted `Forwarded` headers. //! //! ## Usage //! //! ``` //! use rfc7239::parse; -//! # use std::error::Error; +//! # use core::error::Error; //! //! # fn main() -> Result<(), Box> { //! // get the header value from your favorite http server library @@ -21,10 +22,16 @@ //! ``` //! //! [rfc7239]: https://tools.ietf.org/html/rfc7239 -use std::error::Error; -use std::fmt::{Debug, Display, Formatter}; -use std::net::IpAddr; -use std::str::FromStr; + +#[cfg(test)] +extern crate std; +#[cfg(test)] +use std::{format, vec, vec::Vec}; + +use core::error::Error; +use core::fmt::{Debug, Display, Formatter}; +use core::net::IpAddr; +use core::str::FromStr; use uncased::UncasedStr; #[derive(Debug)] @@ -36,7 +43,7 @@ pub enum RfcError { } impl Display for RfcError { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { let str = match self { RfcError::InvalidIdentifier => "Invalid node identifier", RfcError::InvalidPort => "Invalid node port", @@ -115,7 +122,7 @@ impl<'a> Forwarded<'a> { } impl<'a> Display for Forwarded<'a> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { let mut needs_delim = false; if let Some(ident) = &self.forwarded_for { if ident.display_needs_quote() { @@ -248,7 +255,7 @@ impl<'a> NodeIdentifier<'a> { } impl<'a> Display for NodeIdentifier<'a> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self.port { Some(port) => write!(f, "{}:{}", self.name, port), None => write!(f, "{}", self.name), @@ -376,7 +383,7 @@ impl<'a> NodeName<'a> { } impl<'a> Display for NodeName<'a> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self { NodeName::Ip(IpAddr::V4(ip)) => write!(f, "{}", ip), NodeName::Ip(IpAddr::V6(ip)) => write!(f, "[{}]", ip), From b36dc994a15653d2ca3f2d73184b48b666f6bcf8 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 11 Dec 2024 23:58:24 +0100 Subject: [PATCH 04/10] updates --- Cargo.lock | 4 ++-- flake.lock | 32 ++++++++++++++++---------------- flake.nix | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5f69aa..50c48bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,6 +20,6 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" diff --git a/flake.lock b/flake.lock index c377800..6b4f455 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1730060262, - "narHash": "sha256-RMgSVkZ9H03sxC+Vh4jxtLTCzSjPq18UWpiM0gq6shQ=", + "lastModified": 1733688869, + "narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=", "owner": "ipetkov", "repo": "crane", - "rev": "498d9f122c413ee1154e8131ace5a35a80d8fa76", + "rev": "604637106e420ad99907cae401e13ab6b452e7d9", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1732697024, - "narHash": "sha256-GcLauDQQI4xO4vy3e2QxPneR86FsJ1ubAbFDlTyEZ9s=", + "lastModified": 1733748390, + "narHash": "sha256-UqTETFjEkwu7WAtlRJPoM7rZpkMnvM9LeupKes+Breg=", "owner": "nix-community", "repo": "flakelight", - "rev": "1af817b5987e78b7a260dff6d62793716b98d794", + "rev": "3b6d1f0651f7cf4f4dc17c45e12782778a11520b", "type": "github" }, "original": { @@ -44,11 +44,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1732306573, - "narHash": "sha256-wE12kIIE0qb9V9y0JiVm5RsRrMNX+KeeMwkzwefdHhY=", + "lastModified": 1733960382, + "narHash": "sha256-nxXb6K11rn08h1leZYkTYWCIjniUNPvMovwdxXqfQjg=", "owner": "icewind1991", "repo": "mill-scale", - "rev": "8b4cbf174a9728d7e58bbfde5b5a6685dcbf1015", + "rev": "77800944c23ea0d061a228aad1bcd9e9043060cc", "type": "github" }, "original": { @@ -59,16 +59,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1732632634, - "narHash": "sha256-+G7n/ZD635aN0sEXQLynU7pWMd3PKDM7yBIXvYmjABQ=", + "lastModified": 1733808091, + "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6f6076c37180ea3a916f84928cf3a714c5207a30", + "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-24.05", + "ref": "nixos-24.11", "type": "indirect" } }, @@ -88,11 +88,11 @@ ] }, "locked": { - "lastModified": 1731897198, - "narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=", + "lastModified": 1733884434, + "narHash": "sha256-8GXR9kC07dyOIshAyfZhG11xfvBRSZzYghnZ2weOKJU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "0be641045af6d8666c11c2c40e45ffc9667839b5", + "rev": "d0483df44ddf0fd1985f564abccbe568e020ddf2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4fffa0a..e0a3279 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "nixpkgs/nixos-24.05"; + nixpkgs.url = "nixpkgs/nixos-24.11"; flakelight = { url = "github:nix-community/flakelight"; inputs.nixpkgs.follows = "nixpkgs"; From 432d2393cbc69cf7308ebc4b10714ed880c9d55c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 12 Dec 2024 00:09:54 +0100 Subject: [PATCH 05/10] feature gate no_std --- Cargo.toml | 4 ++++ README.md | 6 ++++++ src/lib.rs | 25 ++++++++++++++++++------- 3 files changed, 28 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 096c8f3..f724832 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,3 +11,7 @@ rust-version = "1.56.1" [dependencies] uncased = "0.9.10" + +[features] +std = [] +default = ["std"] \ No newline at end of file diff --git a/README.md b/README.md index 77d3d1f..e84d807 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,10 @@ for node_result in parse(header_value) { } ``` +## `no_std` + +This crate can be used in a `no_std` environment by disabling the default `std` feature. + +The only impact disabling this feature has is using `core::error::Error` and `core::net::IpAddr` instead of the `std` variants and increasing the msrv to 1.81. + [rfc7239]: https://tools.ietf.org/html/rfc7239 diff --git a/src/lib.rs b/src/lib.rs index 8a6ce50..bfc8267 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ -#![no_std] +#![cfg_attr(not(feature = "std"), no_std)] + //! Parser for [rfc7239] formatted `Forwarded` headers. //! //! ## Usage @@ -23,15 +24,25 @@ //! //! [rfc7239]: https://tools.ietf.org/html/rfc7239 -#[cfg(test)] +#[cfg(all(test, not(feature = "std")))] extern crate std; -#[cfg(test)] +#[cfg(all(test, not(feature = "std")))] use std::{format, vec, vec::Vec}; -use core::error::Error; -use core::fmt::{Debug, Display, Formatter}; -use core::net::IpAddr; -use core::str::FromStr; +#[cfg(not(feature = "std"))] +use core::{ + error::Error, + fmt::{Debug, Display, Formatter}, + net::IpAddr, + str::FromStr, +}; +#[cfg(feature = "std")] +use std::{ + error::Error, + fmt::{Debug, Display, Formatter}, + net::IpAddr, + str::FromStr, +}; use uncased::UncasedStr; #[derive(Debug)] From d82a9506b7ec40c9d4afefa6a23eb7b1f6db86ec Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 12 Dec 2024 00:38:34 +0100 Subject: [PATCH 06/10] clippy fixes --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index bfc8267..49d279b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -132,7 +132,7 @@ impl<'a> Forwarded<'a> { } } -impl<'a> Display for Forwarded<'a> { +impl Display for Forwarded<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { let mut needs_delim = false; if let Some(ident) = &self.forwarded_for { @@ -265,7 +265,7 @@ impl<'a> NodeIdentifier<'a> { } } -impl<'a> Display for NodeIdentifier<'a> { +impl Display for NodeIdentifier<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self.port { Some(port) => write!(f, "{}:{}", self.name, port), @@ -393,7 +393,7 @@ impl<'a> NodeName<'a> { } } -impl<'a> Display for NodeName<'a> { +impl Display for NodeName<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result { match self { NodeName::Ip(IpAddr::V4(ip)) => write!(f, "{}", ip), From 35f361468592a83a05b514e5356f14f24e528369 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 23 May 2025 21:58:46 +0200 Subject: [PATCH 07/10] flake updates --- flake.lock | 42 +++++++++++++++++++++--------------------- flake.nix | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 6b4f455..eb5effb 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "crane": { "locked": { - "lastModified": 1733688869, - "narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=", + "lastModified": 1742394900, + "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", "owner": "ipetkov", "repo": "crane", - "rev": "604637106e420ad99907cae401e13ab6b452e7d9", + "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", "type": "github" }, "original": { @@ -22,11 +22,11 @@ ] }, "locked": { - "lastModified": 1733748390, - "narHash": "sha256-UqTETFjEkwu7WAtlRJPoM7rZpkMnvM9LeupKes+Breg=", + "lastModified": 1747659009, + "narHash": "sha256-3FFAthqh4rWKTClF+WgM+9CmMDlnfWcPdd3hGBFVNHc=", "owner": "nix-community", "repo": "flakelight", - "rev": "3b6d1f0651f7cf4f4dc17c45e12782778a11520b", + "rev": "93d72adbe0b022791b0faadfb31cb6e98c37f0ad", "type": "github" }, "original": { @@ -44,26 +44,26 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1733960382, - "narHash": "sha256-nxXb6K11rn08h1leZYkTYWCIjniUNPvMovwdxXqfQjg=", - "owner": "icewind1991", - "repo": "mill-scale", - "rev": "77800944c23ea0d061a228aad1bcd9e9043060cc", - "type": "github" + "lastModified": 1747928985, + "narHash": "sha256-OGJvoEbcclL566m9PCq+SdOQ9vJzLfVCOkww9L/uZT8=", + "ref": "refs/heads/main", + "rev": "742b8596357b53bf437d504a87455f46edba8be2", + "revCount": 46, + "type": "git", + "url": "https://codeberg.org/icewind/mill-scale.git" }, "original": { - "owner": "icewind1991", - "repo": "mill-scale", - "type": "github" + "type": "git", + "url": "https://codeberg.org/icewind/mill-scale.git" } }, "nixpkgs": { "locked": { - "lastModified": 1733808091, - "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", + "lastModified": 1747862697, + "narHash": "sha256-U4HaNZ1W26cbOVm0Eb5OdGSnfQVWQKbLSPrSSa78KC0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", + "rev": "2baa12ff69913392faf0ace833bc54bba297ea95", "type": "github" }, "original": { @@ -88,11 +88,11 @@ ] }, "locked": { - "lastModified": 1733884434, - "narHash": "sha256-8GXR9kC07dyOIshAyfZhG11xfvBRSZzYghnZ2weOKJU=", + "lastModified": 1742697269, + "narHash": "sha256-Lpp0XyAtIl1oGJzNmTiTGLhTkcUjwSkEb0gOiNzYFGM=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "d0483df44ddf0fd1985f564abccbe568e020ddf2", + "rev": "01973c84732f9275c50c5f075dd1f54cc04b3316", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e0a3279..ddacbeb 100644 --- a/flake.nix +++ b/flake.nix @@ -6,9 +6,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; mill-scale = { - url = "github:icewind1991/mill-scale"; + url = "git+https://codeberg.org/icewind/mill-scale.git"; inputs.flakelight.follows = "flakelight"; }; }; - outputs = { mill-scale, ... }: mill-scale ./. { }; + outputs = {mill-scale, ...}: mill-scale ./. {}; } From 5b55fcf7215ff15d66aa3bb65ba85c2a87d2d1f9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 23 May 2025 21:59:25 +0200 Subject: [PATCH 08/10] format readme --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e84d807..fae079b 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,11 @@ for node_result in parse(header_value) { ## `no_std` -This crate can be used in a `no_std` environment by disabling the default `std` feature. +This crate can be used in a `no_std` environment by disabling the default `std` +feature. -The only impact disabling this feature has is using `core::error::Error` and `core::net::IpAddr` instead of the `std` variants and increasing the msrv to 1.81. +The only impact disabling this feature has is using `core::error::Error` and +`core::net::IpAddr` instead of the `std` variants and increasing the msrv to +1.81. [rfc7239]: https://tools.ietf.org/html/rfc7239 From 3227c7151fa43db463c7f18828cbd6fcae81307e Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 23 May 2025 22:00:08 +0200 Subject: [PATCH 09/10] update workflows --- {.github => .forgejo}/workflows/ci.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) rename {.github => .forgejo}/workflows/ci.yaml (53%) diff --git a/.github/workflows/ci.yaml b/.forgejo/workflows/ci.yaml similarity index 53% rename from .github/workflows/ci.yaml rename to .forgejo/workflows/ci.yaml index fb87a7a..80e25b0 100644 --- a/.github/workflows/ci.yaml +++ b/.forgejo/workflows/ci.yaml @@ -5,13 +5,12 @@ on: jobs: checks: - runs-on: ubuntu-latest + runs-on: nix steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v26 - - uses: icewind1991/attic-action@v1 + - uses: https://codeberg.org/icewind/attic-action@v1 with: - name: ci - instance: https://cache.icewind.me + name: link + instance: https://cache.icewind.link authToken: "${{ secrets.ATTIC_TOKEN }}" - run: nix flake check --keep-going From 821cf578827710d773c6a387c46a5acbee371450 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 23 May 2025 22:00:48 +0200 Subject: [PATCH 10/10] update repo url --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index f724832..d65019a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Robin Appelman "] edition = "2018" description = "Parser for rfc7239 formatted Forwarded headers" license = "MIT OR Apache-2.0" -repository = "https://github.com/icewind1991/rfc7239" +repository = "https://codeberg.org/icewind/rfc7239" documentation = "https://docs.rs/rfc7239" rust-version = "1.56.1"