Browse Source

Rename RingBuffer#available to free. (#115)

This avoids using the same name as recv_buffer_available_bytes.
Andrew Walbran 1 year ago
parent
commit
a812115be2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/device/socket/connectionmanager.rs

+ 2 - 2
src/device/socket/connectionmanager.rs

@@ -333,7 +333,7 @@ impl RingBuffer {
     }
 
     /// Returns the number of bytes currently free in the buffer.
-    pub fn available(&self) -> usize {
+    pub fn free(&self) -> usize {
         self.buffer.len() - self.used
     }
 
@@ -341,7 +341,7 @@ impl RingBuffer {
     ///
     /// Returns true if they were added, or false if they were not.
     pub fn add(&mut self, bytes: &[u8]) -> bool {
-        if bytes.len() > self.available() {
+        if bytes.len() > self.free() {
             return false;
         }