Rollup merge of #25876 - tshepang:patch-3, r=steveklabnik
This commit is contained in:
commit
697834f485
1 changed files with 2 additions and 4 deletions
|
@ -17,14 +17,12 @@
|
|||
|
||||
use std::slice;
|
||||
|
||||
pub type IoResult<T> = Result<T, ()>;
|
||||
|
||||
trait MyWriter {
|
||||
fn my_write(&mut self, buf: &[u8]) -> IoResult<()>;
|
||||
fn my_write(&mut self, buf: &[u8]) -> Result<(), ()>;
|
||||
}
|
||||
|
||||
impl<'a> MyWriter for &'a mut [u8] {
|
||||
fn my_write(&mut self, buf: &[u8]) -> IoResult<()> {
|
||||
fn my_write(&mut self, buf: &[u8]) -> Result<(), ()> {
|
||||
slice::bytes::copy_memory(buf, *self);
|
||||
|
||||
let write_len = buf.len();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue