Bläddra i källkod

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

whitequark 8 år sedan
förälder
incheckning
03212f2843
7 ändrade filer med 11 tillägg och 6 borttagningar
  1. 1 0
      Cargo.toml
  2. 5 0
      README.md
  3. 0 1
      src/lib.rs
  4. 1 1
      src/socket/udp.rs
  5. 1 1
      src/wire/ethernet.rs
  6. 1 1
      src/wire/ip.rs
  7. 2 2
      src/wire/ipv4.rs

+ 1 - 0
Cargo.toml

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

+ 5 - 0
README.md

@@ -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
 --------
 

+ 0 - 1
src/lib.rs

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

+ 1 - 1
src/socket/udp.rs

@@ -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()
         }

+ 1 - 1
src/wire/ethernet.rs

@@ -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.
     ///

+ 1 - 1
src/wire/ip.rs

@@ -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 {

+ 2 - 2
src/wire/ipv4.rs

@@ -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.
     ///