@@ -154,73 +154,49 @@ cfg_if! {
154154}
155155
156156mod error;
157- pub use crate :: error:: Error ;
158-
159- #[ allow( dead_code) ]
160157mod util;
161158
162- #[ cfg( all(
163- unix,
164- not( any(
165- target_os = "ios" ,
166- target_os = "fuchsia" ,
167- target_os = "hermit" ,
168- target_os = "l4re"
169- ) )
170- ) ) ]
171- #[ allow( dead_code) ]
172- mod util_libc;
173-
174159#[ cfg( feature = "std" ) ]
175160mod error_impls;
176161
177- // These targets read from a file as a fallback method.
178- #[ cfg( any(
179- target_os = "android" ,
180- target_os = "linux" ,
181- target_os = "macos" ,
182- target_os = "solaris" ,
183- target_os = "illumos" ,
184- ) ) ]
185- mod use_file;
162+ pub use crate :: error:: Error ;
186163
187164// System-specific implementations.
188165//
189166// These should all provide getrandom_inner with the same signature as getrandom.
190167cfg_if ! {
191- if #[ cfg( target_os = "android" ) ] {
168+ if #[ cfg( any( target_os = "dragonfly" , target_os = "emscripten" ,
169+ target_os = "haiku" , target_os = "redox" ) ) ] {
170+ mod util_libc;
171+ #[ path = "use_file.rs" ] mod imp;
172+ } else if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
173+ mod util_libc;
174+ mod use_file;
192175 #[ path = "linux_android.rs" ] mod imp;
176+ } else if #[ cfg( any( target_os = "illumos" , target_os = "solaris" ) ) ] {
177+ mod util_libc;
178+ mod use_file;
179+ #[ path = "solaris_illumos.rs" ] mod imp;
180+ } else if #[ cfg( any( target_os = "freebsd" , target_os = "netbsd" ) ) ] {
181+ mod util_libc;
182+ #[ path = "bsd_arandom.rs" ] mod imp;
193183 } else if #[ cfg( target_os = "cloudabi" ) ] {
194184 #[ path = "cloudabi.rs" ] mod imp;
195- } else if #[ cfg( target_os = "dragonfly" ) ] {
196- #[ path = "use_file.rs" ] mod imp;
197- } else if #[ cfg( target_os = "emscripten" ) ] {
198- #[ path = "use_file.rs" ] mod imp;
199- } else if #[ cfg( target_os = "freebsd" ) ] {
200- #[ path = "bsd_arandom.rs" ] mod imp;
201185 } else if #[ cfg( target_os = "fuchsia" ) ] {
202186 #[ path = "fuchsia.rs" ] mod imp;
203- } else if #[ cfg( target_os = "haiku" ) ] {
204- #[ path = "use_file.rs" ] mod imp;
205- } else if #[ cfg( target_os = "illumos" ) ] {
206- #[ path = "solaris_illumos.rs" ] mod imp;
207187 } else if #[ cfg( target_os = "ios" ) ] {
208188 #[ path = "ios.rs" ] mod imp;
209- } else if #[ cfg( target_os = "linux" ) ] {
210- #[ path = "linux_android.rs" ] mod imp;
211189 } else if #[ cfg( target_os = "macos" ) ] {
190+ mod util_libc;
191+ mod use_file;
212192 #[ path = "macos.rs" ] mod imp;
213- } else if #[ cfg( target_os = "netbsd" ) ] {
214- #[ path = "bsd_arandom.rs" ] mod imp;
215193 } else if #[ cfg( target_os = "openbsd" ) ] {
194+ mod util_libc;
216195 #[ path = "openbsd.rs" ] mod imp;
217- } else if #[ cfg( target_os = "redox" ) ] {
218- #[ path = "use_file.rs" ] mod imp;
219- } else if #[ cfg( target_os = "solaris" ) ] {
220- #[ path = "solaris_illumos.rs" ] mod imp;
221196 } else if #[ cfg( target_os = "wasi" ) ] {
222197 #[ path = "wasi.rs" ] mod imp;
223198 } else if #[ cfg( target_os = "vxworks" ) ] {
199+ mod util_libc;
224200 #[ path = "vxworks.rs" ] mod imp;
225201 } else if #[ cfg( all( windows, getrandom_uwp) ) ] {
226202 #[ path = "windows_uwp.rs" ] mod imp;
0 commit comments