Make cfg_if uses more explicit and consistent
This commit changes most uses of cfg_if as follows:
- fallthrough `else` usage is avoided for architecture or OS specific
items
- a comment is added in the final `else` clause to signal intent someone
modifying
It is safer to omit items than include ones for the wrong platform or
architecture.
diff --git a/src/lib.rs b/src/lib.rs
index 57919c5..2593e3b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -258,8 +258,10 @@
if #[cfg(windows)] {
mod windows;
pub use windows::*;
- } else {
+ } else if #[cfg(unix)] {
mod unix;
pub use unix::*;
+ } else {
+ // Unknown target_family
}
}