diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 82a5462b1ee398dfb711b6297bc52e2044fea66b..d03517591f05b8587880a0492d4051c58cf560a4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -5,8 +5,8 @@ "tasks": [ { "type": "shell", - "label": "cargo run --example example --features debug-fmt", - "command": "cargo run --example example --features debug-fmt", + "label": "cargo +stable run --example example --features debug-fmt", + "command": "cargo +stable run --example example --features debug-fmt", "problemMatcher": [ "$rustc" ], @@ -17,8 +17,8 @@ }, { "type": "shell", - "label": "cargo run --example example2 --features debug-fmt", - "command": "cargo run --example example2 --features debug-fmt", + "label": "cargo +nightly run --example example2 --features 'debug-fmt nightly'", + "command": "cargo +nightly run --example example2 --features 'debug-fmt nightly'", "problemMatcher": [ "$rustc" ], diff --git a/Cargo.toml b/Cargo.toml index 4aca0f97bcf2656894a4ab618f142b767a318573..769e7d7360b40869f55351668d648bba6e357320 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,15 @@ version = "0.3.0" [dependencies] vcell = "0.1.0" +array-debug = { git = "https://gitlab.henriktjader.com/pln/array-debug", optional = true } [features] debug-fmt = [] +nightly = ["array-debug"] -[dev-dependencies] -array-debug = { git = "https://gitlab.henriktjader.com/pln/array-debug" } \ No newline at end of file +[[example]] +name = "example" + +[[example]] +name = "example2" +required-features = ["nightly"] diff --git a/README.md b/README.md index 74673ce766e675b84ce383d61b31af5e489927d9..216967902047e6b54c722436da325fd66045409b 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,11 @@ Notice, the current implementation of `array-debug` (see `examples/example2.rs`) ``` rust +//! Example to show the use of `Debug` formatting for small register arrays +//! +//! > cargo +stable run --example example --features debug-fmt +//! + extern crate volatile_register; use std::mem; use volatile_register::{RW}; @@ -46,6 +51,11 @@ Registers will be formatted under `UpperHex`, notice in the example that arrays For register arrays with more then 32 elements, `array-debug` provides a newtype over array, replicating the array behavior while providing `Debug`. ``` rust +//! Example to show the use of ¡Debug` formatting for big register arrays +//! +//! > cargo +nightly run --example example2 --features 'debug-fmt nightly' +//! + extern crate array_debug; extern crate volatile_register; diff --git a/examples/example.rs b/examples/example.rs index dd87d7fbcac582cc689265090e3664111623b450..49acf9310ef236c75c15d51e2d68621b5484f955 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -1,6 +1,6 @@ //! Example to show the use of `Debug` formatting for small register arrays //! -//! > cargo run --example example2 --features debug-fmt +//! > cargo +stable run --example example --features debug-fmt //! extern crate volatile_register; diff --git a/examples/example2.rs b/examples/example2.rs index 805e28fb489a4614e526fb223fbaf19ebd4b5057..7334539a8359d2a2a43125e7821e8d571dea8958 100644 --- a/examples/example2.rs +++ b/examples/example2.rs @@ -1,6 +1,6 @@ //! Example to show the use of ¡Debug` formatting for big register arrays //! -//! > cargo run --example example2 --features debug-fmt +//! > cargo +nightly run --example example2 --features 'debug-fmt nightly' //! extern crate array_debug;