From 369d11587339ce74f8ebc76f2607fe55545eaf7d Mon Sep 17 00:00:00 2001 From: garhve Date: Tue, 20 Dec 2022 11:04:25 +0800 Subject: Build small project following the book --- .../guessing_game/target/doc/cfg_if/index.html | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 rust/theBook/chapter-2-guessing-game/guessing_game/target/doc/cfg_if/index.html (limited to 'rust/theBook/chapter-2-guessing-game/guessing_game/target/doc/cfg_if/index.html') diff --git a/rust/theBook/chapter-2-guessing-game/guessing_game/target/doc/cfg_if/index.html b/rust/theBook/chapter-2-guessing-game/guessing_game/target/doc/cfg_if/index.html new file mode 100644 index 0000000..7c0909d --- /dev/null +++ b/rust/theBook/chapter-2-guessing-game/guessing_game/target/doc/cfg_if/index.html @@ -0,0 +1,19 @@ +cfg_if - Rust
Expand description

A macro for defining #[cfg] if-else statements.

+

The macro provided by this crate, cfg_if, is similar to the if/elif C +preprocessor macro by allowing definition of a cascade of #[cfg] cases, +emitting the implementation which matches first.

+

This allows you to conveniently provide a long list #[cfg]’d blocks of code +without having to rewrite each clause multiple times.

+

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 */ }
+    }
+}
+
+

Macros

The main macro provided by this crate. See crate documentation for more +information.
\ No newline at end of file -- cgit v1.2.3-70-g09d2