Commit 3e0ffe04 authored by Per Lindgren's avatar Per Lindgren

stable vs nightly features

parent 439e31cd
......@@ -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"
],
......
......@@ -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"]
......@@ -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;
......
//! 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;
......
//! 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment