Skip to content

Commit

Permalink
Refactor some code
Browse files Browse the repository at this point in the history
  • Loading branch information
yaa110 committed Dec 28, 2020
1 parent 9d45cee commit 1458e1b
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 288 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iptables"
version = "0.3.0"
version = "0.4.0"
authors = ["Navid Fathollahzade <[email protected]>", "Pit Kleyersburg <[email protected]>"]
edition = "2018"
description = "Rust bindings for iptables"
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This crate provides bindings for [iptables](https://www.netfilter.org/projects/i

```toml
[dependencies]
iptables = "0.3"
iptables = "0.4"
```

## Getting started
Expand All @@ -16,11 +16,11 @@ iptables = "0.3"
```rust
let ipt = iptables::new(false).unwrap();

assert_eq!(ipt.new_chain("nat", "NEWCHAINNAME").unwrap(), true);
assert_eq!(ipt.append("nat", "NEWCHAINNAME", "-j ACCEPT").unwrap(), true);
assert_eq!(ipt.exists("nat", "NEWCHAINNAME", "-j ACCEPT").unwrap(), true);
assert_eq!(ipt.delete("nat", "NEWCHAINNAME", "-j ACCEPT").unwrap(), true);
assert_eq!(ipt.delete_chain("nat", "NEWCHAINNAME").unwrap(), true);
assert!(ipt.new_chain("nat", "NEWCHAINNAME").is_ok());
assert!(ipt.append("nat", "NEWCHAINNAME", "-j ACCEPT").is_ok());
assert!(ipt.exists("nat", "NEWCHAINNAME", "-j ACCEPT").unwrap());
assert!(ipt.delete("nat", "NEWCHAINNAME", "-j ACCEPT").is_ok());
assert!(ipt.delete_chain("nat", "NEWCHAINNAME").is_ok());
```

For more information, please check the test file in `tests` folder.
78 changes: 0 additions & 78 deletions src/error.rs

This file was deleted.

Loading

0 comments on commit 1458e1b

Please sign in to comment.