mirror of
https://gitee.com/openharmony/third_party_rust_cfg-if
synced 2024-11-27 01:03:13 +00:00
Update example usage
This commit is contained in:
parent
416d240b1e
commit
cb89f6a131
@ -16,10 +16,7 @@ cfg-if = "0.1"
|
||||
## Example
|
||||
|
||||
```rust
|
||||
#[macro_use]
|
||||
extern crate cfg_if;
|
||||
|
||||
cfg_if! {
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(unix)] {
|
||||
fn foo() { /* unix specific functionality */ }
|
||||
} else if #[cfg(target_pointer_width = "32")] {
|
||||
|
@ -10,10 +10,7 @@
|
||||
//! # Example
|
||||
//!
|
||||
//! ```
|
||||
//! #[macro_use]
|
||||
//! extern crate cfg_if;
|
||||
//!
|
||||
//! cfg_if! {
|
||||
//! cfg_if::cfg_if! {
|
||||
//! if #[cfg(unix)] {
|
||||
//! fn foo() { /* unix specific functionality */ }
|
||||
//! } else if #[cfg(target_pointer_width = "32")] {
|
||||
|
Loading…
Reference in New Issue
Block a user