Get rid of the #![feature(associated_consts)].

v0.7.x
whitequark 2016-12-28 00:12:15 +00:00
parent 71268ace88
commit 151b3ba07b
7 changed files with 11 additions and 6 deletions

View File

@ -3,6 +3,7 @@ name = "smoltcp"
version = "0.1.0"
authors = ["whitequark <whitequark@whitequark.org>"]
license = "0BSD"
readme-file = "README.md"
[dependencies]
byteorder = { version = "0.5", default-features = false }

View File

@ -6,6 +6,11 @@ real-time systems. Its design goals are simplicity and robustness. Its design an
include complicated compile-time computations, such as macro or type tricks, even
at cost of performance degradation.
_smoltcp_ does not need heap allocation *at all*, is [extensively documented][docs],
and compiles on stable Rust.
[docs]: https://m-labs.github.io/smoltcp/smoltcp/index.html
Features
--------

View File

@ -1,4 +1,3 @@
#![feature(associated_consts)]
#![cfg_attr(feature = "use_alloc", feature(alloc))]
#![no_std]

View File

@ -17,7 +17,7 @@ impl<'a> PacketBuffer<'a> {
pub fn new<T>(payload: T) -> PacketBuffer<'a>
where T: Into<Managed<'a, [u8]>> {
PacketBuffer {
endpoint: IpEndpoint::UNSPECIFIED,
endpoint: IpEndpoint::default(),
size: 0,
payload: payload.into()
}

View File

@ -28,7 +28,7 @@ impl fmt::Display for EtherType {
pub struct Address(pub [u8; 6]);
impl Address {
pub const BROADCAST: Address = Address([0xff; 6]);
// pub const BROADCAST: Address = Address([0xff; 6]);
/// Construct an Ethernet address from a sequence of octets, in big-endian.
///

View File

@ -85,7 +85,7 @@ pub struct Endpoint {
}
impl Endpoint {
pub const UNSPECIFIED: Endpoint = Endpoint { addr: Address::Unspecified, port: 0 };
// pub const UNSPECIFIED: Endpoint = Endpoint { addr: Address::Unspecified, port: 0 };
/// Create an endpoint address from given address and port.
pub fn new(addr: Address, port: u16) -> Endpoint {

View File

@ -11,8 +11,8 @@ pub use super::IpProtocol as Protocol;
pub struct Address(pub [u8; 4]);
impl Address {
pub const UNSPECIFIED: Address = Address([0x00; 4]);
pub const BROADCAST: Address = Address([0xff; 4]);
// pub const UNSPECIFIED: Address = Address([0x00; 4]);
// pub const BROADCAST: Address = Address([0xff; 4]);
/// Construct an IPv4 address from a sequence of octets, in big-endian.
///