1- use std:: io:: { self , Read , Seek , SeekFrom , Write } ;
1+ //! The traits in this file copy certain methods and docstrings from the position-io module
2+ //! https://crates.io/crates/positioned-io
3+ //! postioned-io is under the MIT license
4+ //!
5+ //! They are copied here as the positioned-io crate takes a lot of dependencies
6+ //! on std::File which we don't need or want due to Wasm limitations.
27
3- /**
4- * The traits in this file copy certain methods and docstrings from the position-io module
5- * https://crates.io/crates/positioned-io
6- * postioned-io is under the MIT license
7- *
8- * They are copied here as the positioned-io crate takes a lot of dependencies
9- * on std::File which we don't need or want due to Wasm limitations.
10- */
8+ use std:: io:: { self , Read , Seek , SeekFrom , Write } ;
119
1210pub trait PositionedReader {
1311 /// Reads bytes from an offset in this source into a buffer, returning how
@@ -120,7 +118,7 @@ impl PositionedReader for Vec<u8> {
120118 }
121119}
122120
123- impl < ' a > PositionedReader for & ' a [ u8 ] {
121+ impl PositionedReader for & [ u8 ] {
124122 fn read_at ( & self , pos : usize , buf : & mut [ u8 ] ) -> io:: Result < usize > {
125123 if pos >= self . len ( ) {
126124 return Ok ( 0 ) ;
@@ -195,7 +193,7 @@ impl<I: PositionedReader> Seek for PositionedCursor<I> {
195193
196194// Ref implementations
197195
198- impl < ' a , T : ?Sized + PositionedReader > PositionedReader for & ' a T {
196+ impl < T : ?Sized + PositionedReader > PositionedReader for & T {
199197 fn read_at ( & self , pos : usize , buf : & mut [ u8 ] ) -> io:: Result < usize > {
200198 T :: read_at ( self , pos, buf)
201199 }
@@ -205,7 +203,7 @@ impl<'a, T: ?Sized + PositionedReader> PositionedReader for &'a T {
205203 }
206204}
207205
208- impl < ' a , T : ?Sized + PositionedReader > PositionedReader for & ' a mut T {
206+ impl < T : ?Sized + PositionedReader > PositionedReader for & mut T {
209207 fn read_at ( & self , pos : usize , buf : & mut [ u8 ] ) -> io:: Result < usize > {
210208 T :: read_at ( self , pos, buf)
211209 }
@@ -215,7 +213,7 @@ impl<'a, T: ?Sized + PositionedReader> PositionedReader for &'a mut T {
215213 }
216214}
217215
218- impl < ' a , T : ?Sized + PositionedWriter > PositionedWriter for & ' a mut T {
216+ impl < T : ?Sized + PositionedWriter > PositionedWriter for & mut T {
219217 fn write_at ( & mut self , pos : usize , buf : & [ u8 ] ) -> io:: Result < usize > {
220218 T :: write_at ( self , pos, buf)
221219 }
0 commit comments