Skip to content

Commit 309d0f5

Browse files
committedJan 22, 2017
Fix build with no alloc or collections.
1 parent 6a2c009 commit 309d0f5

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
 

Diff for: ‎src/socket/set.rs

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ impl<'a, 'b: 'a, 'c: 'a + 'b> Set<'a, 'b, 'c> {
6161
ManagedSlice::Borrowed(_) => {
6262
panic!("adding a socket to a full SocketSet")
6363
}
64+
#[cfg(any(feature = "use_std", feature = "use_collections"))]
6465
ManagedSlice::Owned(ref mut sockets) => {
6566
sockets.push(None);
6667
let index = sockets.len() - 1;

Diff for: ‎src/socket/tcp.rs

+2
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ impl<'a> TcpSocket<'a> {
477477
pub fn send(&mut self, size: usize) -> Result<&mut [u8], ()> {
478478
if !self.may_send() { return Err(()) }
479479

480+
#[cfg(any(test, feature = "verbose"))]
480481
let old_length = self.tx_buffer.len();
481482
let buffer = self.tx_buffer.enqueue(size);
482483
if buffer.len() > 0 {
@@ -512,6 +513,7 @@ impl<'a> TcpSocket<'a> {
512513
// but until the connection is fully open we refuse to dequeue any data.
513514
if !self.may_recv() { return Err(()) }
514515

516+
#[cfg(any(test, feature = "verbose"))]
515517
let old_length = self.rx_buffer.len();
516518
let buffer = self.rx_buffer.dequeue(size);
517519
self.remote_seq_no += buffer.len();

0 commit comments

Comments
 (0)
Please sign in to comment.