Skip to content

Commit

Permalink
Rewrite IpRange, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Deniskore committed Aug 17, 2024
1 parent 55ce93e commit 0770f49
Show file tree
Hide file tree
Showing 7 changed files with 373 additions and 202 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.65
- uses: dtolnay/rust-toolchain@1.70
- run: cargo check

test:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.65
- uses: dtolnay/rust-toolchain@1.70
- run: cargo test

fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.65
- uses: dtolnay/rust-toolchain@1.70
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check

Expand All @@ -33,6 +33,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.65
- uses: dtolnay/rust-toolchain@1.70
- run: rustup component add clippy
- run: cargo clippy -- -D warnings
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iptools"
version = "0.2.5"
version = "0.3.0"
authors = ["Denis Avvakumov"]
license = "MIT"
readme = "README.md"
Expand All @@ -14,9 +14,9 @@ categories = ["algorithms", "network-programming"]
edition = "2021"

[dependencies]
regex = "1.10.3"
regex = "1.10.6"
once_cell = "1.19.0"
ahash = "0.8.7"
ahash = "0.8.11"

[dev-dependencies]
pretty_assertions = "1.4.0"
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ This is a port of package [iptools](https://github.com/bd808/python-iptools) fro
Add the following dependency to your Cargo manifest:
```
[dependencies]
iptools = "0.2.5"
iptools = "0.3.0"
```

## Example of usage
```rust
let first_range = IpRange::new("127.0.0.1/16", "").unwrap();
let second_range = IpRange::new("127.0.0.1", "127.0.0.255").unwrap();
let first_range = IpRange::<IPv4>::new("127.0.0.1/16", "").unwrap();
let second_range = IpRange::<IPv4>::new("127.0.0.1", "127.0.0.255").unwrap();
// Print range (tuple)
println!("{:?} {:?}", first_range.get_range(), second_range.get_range());
// Ip address range iterator
Expand All @@ -30,7 +30,7 @@ println!("{:?}", first_range.contains("127.0.0.3"));
```

## Supported Rust Versions
Rust 1.65.0+
Rust 1.70.0+

## License

Expand Down
Loading

0 comments on commit 0770f49

Please sign in to comment.