releases-comm-central/third_party/rust/cfg-if
Rob Lemley 94f8f9398c Bug 1860654 - Add vendored Rust deps. rs=me
This is a reproducible commit. Running mach tb-rust vendor again
with mozilla-central and comm-central on the same head revs will
produce the same output.

https://hg.mozilla.org/mozilla-central/rev/55cd203304b8d5343dd941d772085dc25fd278c4
https://hg.mozilla.org/comm-central/rev/8a0750b85f6d85fbf5c2e17a29fbc8112112c374
2023-12-12 14:05:09 -05:00
..
src Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00
tests Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00
.cargo-checksum.json Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00
Cargo.toml Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00
LICENSE-APACHE Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00
LICENSE-MIT Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00
README.md Bug 1860654 - Add vendored Rust deps. rs=me 2023-12-12 14:05:09 -05:00

README.md

cfg-if

Documentation

A macro to ergonomically define an item depending on a large number of #[cfg] parameters. Structured like an if-else chain, the first matching branch is the item that gets emitted.

[dependencies]
cfg-if = "0.1"

Example

cfg_if::cfg_if! {
    if #[cfg(unix)] {
        fn foo() { /* unix specific functionality */ }
    } else if #[cfg(target_pointer_width = "32")] {
        fn foo() { /* non-unix, 32-bit functionality */ }
    } else {
        fn foo() { /* fallback implementation */ }
    }
}

fn main() {
    foo();
}

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in cfg-if by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.