@@ -82,7 +82,7 @@ impl Serialize for Digest {
8282
8383/// A reader wrapper, which hashes the bytes read
8484pub struct Reader < T > {
85- reader : T ,
85+ inner : T ,
8686 sha256 : Sha256 ,
8787 sha512 : Sha512 ,
8888}
@@ -93,7 +93,7 @@ impl<T: AsyncRead + Unpin> AsyncRead for Reader<T> {
9393 cx : & mut Context < ' _ > ,
9494 buf : & mut [ u8 ] ,
9595 ) -> Poll < std:: io:: Result < usize > > {
96- Pin :: new ( & mut self . reader ) . poll_read ( cx, buf) . map_ok ( |n| {
96+ Pin :: new ( & mut self . inner ) . poll_read ( cx, buf) . map_ok ( |n| {
9797 self . sha256 . update ( & buf[ ..n] ) ;
9898 self . sha512 . update ( & buf[ ..n] ) ;
9999 n
@@ -102,9 +102,9 @@ impl<T: AsyncRead + Unpin> AsyncRead for Reader<T> {
102102}
103103
104104impl < T > From < T > for Reader < T > {
105- fn from ( reader : T ) -> Self {
105+ fn from ( inner : T ) -> Self {
106106 Self {
107- reader ,
107+ inner ,
108108 sha256 : Sha256 :: new ( ) ,
109109 sha512 : Sha512 :: new ( ) ,
110110 }
@@ -121,7 +121,7 @@ impl<T> From<Reader<T>> for Digest {
121121
122122/// A writer wrapper, which hashes the bytes written
123123pub struct Writer < T > {
124- writer : T ,
124+ inner : T ,
125125 sha256 : Sha256 ,
126126 sha512 : Sha512 ,
127127}
@@ -132,26 +132,26 @@ impl<T: AsyncWrite + Unpin> AsyncWrite for Writer<T> {
132132 cx : & mut Context < ' _ > ,
133133 buf : & [ u8 ] ,
134134 ) -> Poll < std:: io:: Result < usize > > {
135- Pin :: new ( & mut self . writer ) . poll_write ( cx, buf) . map_ok ( |n| {
135+ Pin :: new ( & mut self . inner ) . poll_write ( cx, buf) . map_ok ( |n| {
136136 self . sha256 . update ( & buf[ ..n] ) ;
137137 self . sha512 . update ( & buf[ ..n] ) ;
138138 n
139139 } )
140140 }
141141
142142 fn poll_flush ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < std:: io:: Result < ( ) > > {
143- Pin :: new ( & mut self . writer ) . poll_flush ( cx)
143+ Pin :: new ( & mut self . inner ) . poll_flush ( cx)
144144 }
145145
146146 fn poll_close ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < std:: io:: Result < ( ) > > {
147- Pin :: new ( & mut self . writer ) . poll_close ( cx)
147+ Pin :: new ( & mut self . inner ) . poll_close ( cx)
148148 }
149149}
150150
151151impl < T > From < T > for Writer < T > {
152- fn from ( writer : T ) -> Self {
152+ fn from ( inner : T ) -> Self {
153153 Self {
154- writer ,
154+ inner ,
155155 sha256 : Sha256 :: new ( ) ,
156156 sha512 : Sha512 :: new ( ) ,
157157 }
0 commit comments