style: BufferedReader -> BufferedRead
Single-method traits usually use the same name as their method and aren't usually the 'noun' (which is usually an implementation of them instead). Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
		@ -235,7 +235,7 @@ impl BufferedDynamicReader {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
impl crate::tools::BufferedReader for  BufferedDynamicReader {
 | 
					impl crate::tools::BufferedRead for BufferedDynamicReader {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    fn buffered_read(&mut self, offset: u64) -> Result<&[u8], Error> {
 | 
					    fn buffered_read(&mut self, offset: u64) -> Result<&[u8], Error> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -279,7 +279,7 @@ impl std::io::Read for  BufferedDynamicReader {
 | 
				
			|||||||
    fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
 | 
					    fn read(&mut self, buf: &mut [u8]) -> Result<usize, std::io::Error> {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        use std::io::{Error, ErrorKind};
 | 
					        use std::io::{Error, ErrorKind};
 | 
				
			||||||
        use crate::tools::BufferedReader;
 | 
					        use crate::tools::BufferedRead;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        let data = match self.buffered_read(self.read_offset) {
 | 
					        let data = match self.buffered_read(self.read_offset) {
 | 
				
			||||||
            Ok(v) => v,
 | 
					            Ok(v) => v,
 | 
				
			||||||
 | 
				
			|||||||
@ -50,10 +50,10 @@ macro_rules! try_block {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// The `BufferedReader` trait provides a single function
 | 
					/// The `BufferedRead` trait provides a single function
 | 
				
			||||||
/// `buffered_read`. It returns a reference to an internal buffer. The
 | 
					/// `buffered_read`. It returns a reference to an internal buffer. The
 | 
				
			||||||
/// purpose of this traid is to avoid unnecessary data copies.
 | 
					/// purpose of this traid is to avoid unnecessary data copies.
 | 
				
			||||||
pub trait BufferedReader {
 | 
					pub trait BufferedRead {
 | 
				
			||||||
    /// This functions tries to fill the internal buffers, then
 | 
					    /// This functions tries to fill the internal buffers, then
 | 
				
			||||||
    /// returns a reference to the available data. It returns an empty
 | 
					    /// returns a reference to the available data. It returns an empty
 | 
				
			||||||
    /// buffer if `offset` points to the end of the file.
 | 
					    /// buffer if `offset` points to the end of the file.
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user