Strict parsing, faster ranges, split WASM#26
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes iptools for stricter parsing and higher performance, expands allocation-free iteration APIs for IpRange, and splits the WebAssembly demo bindings into a separate iptools-wasm workspace crate while keeping the core crate wasm-compatible.
Changes:
- Tighten IPv4/IPv6 parsing/validation rules (strict dotted-quad IPv4; stricter IPv6 compression + mixed-tail parsing) and gate regex-based validators behind the
stdfeature. - Add faster numeric range/bounds helpers and iteration/formatting adapters (
*_bounds,next_addr,for_each_addr,addrs_view,contains_strict, iterator shortcuts). - Move wasm-bindgen bindings + demo glue into
crates/iptools-wasm, update docs/CI/workspace accordingly.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| WASM.md | Updated WASM build/run docs to reflect the new iptools-wasm wrapper crate. |
| src/lib.rs | Adjusted no_std gating so tests can use std even when the std feature is off. |
| src/error.rs | Added V6Subnet to distinguish IPv6 range/subnet construction errors. |
| src/ipv4/mod.rs | Strict dotted-quad IPv4 parsing; faster formatting; new numeric bounds helpers; regex validators behind std. |
| src/ipv4/tests.rs | Expanded tests for strict IPv4 behavior, numeric bounds helpers, and formatting internals. |
| src/ipv6/mod.rs | Stricter IPv6 parsing; faster long2ip; new numeric bounds helpers; regex validators behind std. |
| src/ipv6/tests.rs | Expanded IPv6 tests for strict parsing and parity between regex/optimized validators. |
| src/iprange/mod.rs | New numeric constructors, allocation-free iteration APIs, AddrView adapter, strict containment paths, and updated reserved-range handling. |
| src/iprange/tests.rs | Expanded tests for new constructors/iterators, strict containment behavior, and edge cases. |
| RS_PY_COMPAT.md | Added explicit documentation of behavior differences vs Python iptools. |
| README.md | Updated version/docs; clarified wasm compatibility and added examples for addrs_view. |
| CHANGELOG.md | Added v0.5.0 changelog covering API additions and behavior changes. |
| Cargo.toml | Converted repo into a workspace including crates/iptools-wasm; updated edition/features/deps. |
| Cargo.lock | Updated dependency graph for new workspace and dependency changes. |
| crates/iptools-wasm/Cargo.toml | New wasm-bindgen demo/bindings crate manifest (not published). |
| crates/iptools-wasm/src/lib.rs | New wasm-bindgen bindings previously embedded in iptools core. |
| crates/iptools-wasm/LICENSE | Added license file for the wasm crate. |
| examples/wasm_demo.html | Improved demo UX, initialization safety, and wasm handle cleanup. |
| benches/ip_bench.rs | Refactored benchmarks to include!() split files and added formatting sink usage. |
| benches/ip_bench/ipv4_core.rs | New split benchmark module for IPv4 core helpers. |
| benches/ip_bench/ipv6_core.rs | New split benchmark module for IPv6 core helpers. |
| benches/ip_bench/ipv4_range.rs | New split benchmark module for IPv4 range operations. |
| benches/ip_bench/ipv6_range.rs | New split benchmark module for IPv6 range operations. |
| benches/ip_bench/ipv4_iteration.rs | New split benchmark module for IPv4 iteration/formatting. |
| benches/ip_bench/ipv6_iteration.rs | New split benchmark module for IPv6 iteration/formatting. |
| .github/workflows/rust.yml | Updated CI matrix/toolchain and added wasm/no_std checks. |
| .github/workflows/ci.yml | Updated CI steps to include no_std wasm checks and wasm crate build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.