@@ -98,14 +98,43 @@ mod imp {
9898 }
9999}
100100
101- #[ cfg( not( feature = "zlib" ) ) ]
101+ #[ cfg( all( not( feature = "zlib" ) , feature = "rust_backend" ) ) ]
102+ mod imp {
103+ extern crate miniz_oxide_c_api;
104+ use std:: ops:: { Deref , DerefMut } ;
105+
106+ pub use ffi:: crc_imp:: * ;
107+ pub use self :: miniz_oxide_c_api:: * ;
108+ pub use self :: miniz_oxide_c_api:: lib_oxide:: * ;
109+
110+ #[ derive( Debug , Default ) ]
111+ pub struct StreamWrapper {
112+ inner : mz_stream ,
113+ }
114+
115+ impl Deref for StreamWrapper {
116+ type Target = mz_stream ;
117+
118+ fn deref ( & self ) -> & Self :: Target {
119+ & self . inner
120+ }
121+ }
122+
123+ impl DerefMut for StreamWrapper {
124+ fn deref_mut ( & mut self ) -> & mut Self :: Target {
125+ & mut self . inner
126+ }
127+ }
128+ }
129+
130+ #[ cfg( all( not( feature = "zlib" ) , not( feature = "rust_backend" ) ) ) ]
102131mod imp {
103132 extern crate miniz_sys;
104133 use std:: mem;
105134 use std:: ops:: { Deref , DerefMut } ;
106135
107- use libc:: { c_ulong, off_t} ;
108136 pub use self :: miniz_sys:: * ;
137+ pub use ffi:: crc_imp:: * ;
109138
110139 pub struct StreamWrapper {
111140 inner : mz_stream ,
@@ -138,7 +167,10 @@ mod imp {
138167 & mut self . inner
139168 }
140169 }
170+ }
141171
172+ mod crc_imp {
173+ use libc:: { c_ulong, off_t} ;
142174 pub unsafe extern fn mz_crc32_combine ( crc1 : c_ulong ,
143175 crc2 : c_ulong ,
144176 len2 : off_t ) -> c_ulong {
0 commit comments