Commit Graph

16 Commits (master)

Author SHA1 Message Date
qiujiangkun 2a574fbca6 various clippy fix 2021-06-27 10:45:57 +02:00
Dario Nieuwenhuis 98fe17890a rustfmt 2021-06-27 09:31:59 +02:00
Dario Nieuwenhuis af4a1e6436 Add medium-ip, medium-ethernet feature flags. 2021-03-31 17:05:09 +02:00
Dario Nieuwenhuis 45df367d7e More clippy fixes. 2021-01-04 01:19:20 +01:00
Alex Crawford 8a961b7d7c Use iterators instead of manually looping
These were flagged by `cargo clippy`:

    warning: the loop variable is used to index

I've verified that this doesn't increase the size of consuming binaries.
Pretty impressive. I tested this with a project that uses the following
features: ethernet, proto-dhcpv4, socket-tcp.
2020-12-28 22:28:07 -08:00
Alex Crawford 321998eb66 Prefer if-let syntax over single-pattern match
These were flagged by `cargo clippy`:

    warning: you seem to be trying to use match for destructuring a
             single pattern. Consider using `if let`

This also silences a few cases where the match couldn't be replaced with
an if because of the following error:

    error: attributes are not yet allowed on `if` expressions

Once we increase the minimum Rust version to 1.43, these can be updated
as well.
2020-12-27 15:20:14 -08:00
Dario Nieuwenhuis 88256dbdcf Update to Rust 2018. Fixes #271 2020-12-27 17:54:56 +01:00
Ruben De Smet eebd8e431a Add ethernet feature-gate as default.
Disable ethernet-related features and framing based on a feature gate.

Add a no-ethernet option to Travis.

notes:
- allow(unused) is added when not using ethernet feature
- Don't run pretty-print doctest, ethernet is optional.

Closes: #308
Approved by: whitequark
2019-10-04 22:49:54 +08:00
Herman J. Radtke III 2419147b45 Handle parsing and display of IPv4 mapped IPv6 addresses.
* The IPv6 address parser now handles IPv4 mapped IPv6 addresses which
  take on the form ::ffff:x.x.x.x.
* Implement Display for IPv4 mapped IPv6 addresses
* Implement From<IPv4Address> for IPv6Address

Fixes #86
2018-01-13 08:49:24 +00:00
Dan Robertson 439e0a2cc1 Add the proto-ipv4 feature. 2017-12-24 13:28:59 +00:00
Herman J. Radtke III 260e3d996f Implement FromStr for IpEndpoint
Fixes #81
2017-12-24 12:08:16 +00:00
Dan Robertson be43f4067a Minor doc improvements to wire::ipv6
- Add links to the Addressing Achitecture RFC where appropriate
 - Add comments to functions where appropriate
2017-11-30 19:20:42 +00:00
Dan Robertson b97c592671 Add IPv6 address and cidr to wire
- Add the ipv6 feature
   - Ensure a travis build with the ipv6 feature enabled.
 - Add the necessary infrastructure to wire for ipv6 support.
   - Ipv6Address
   - Ipv6Cidr
 - Add Ipv6 Address and Cidr parsing to parsers
 - Add basic tests.
2017-11-29 12:57:22 +00:00
whitequark 33fa859665 Do not parse an empty string as an IpAddress.
This is more likely to result in downstream confusion than not.
Let downstream code decide exactly what it wants to do with
an empty string; be conservative here.
2017-10-30 07:20:55 +00:00
Egor Karavaev f57de10625 Implement wire::{IpCidr/Ipv4Cidr}. 2017-10-03 14:27:17 +00:00
whitequark 2c4222a0b6 smoltcp;:parsing → smoltcp::parsers. 2017-09-20 20:18:50 +00:00