Skip to content

Commit 04099af

Browse files
committed
Make cargo test --doc happy
1 parent a047e72 commit 04099af

File tree

12 files changed

+125
-81
lines changed

12 files changed

+125
-81
lines changed

Cargo.lock

Lines changed: 30 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/commands/node/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,17 @@ pub struct Node {
116116
/// Multiaddresses follow the format: `/protocol/address/protocol/port/protocol/peer_id`
117117
///
118118
/// **IPv4 Example:**
119-
/// ```
119+
/// ```text
120120
/// /ip4/192.168.1.100/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
121121
/// ```
122122
///
123123
/// **IPv6 Example:**
124-
/// ```
124+
/// ```text
125125
/// /ip6/2001:db8::1/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
126126
/// ```
127127
///
128128
/// **DNS Example:**
129-
/// ```
129+
/// ```text
130130
/// /dns4/node.example.com/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
131131
/// ```
132132
///
@@ -143,7 +143,7 @@ pub struct Node {
143143
/// Each line should contain a peer's multiaddr following the format described above.
144144
///
145145
/// **Example file content:**
146-
/// ```
146+
/// ```text
147147
/// /ip4/192.168.1.100/tcp/8302/p2p/12D3KooWABCDEF1234567890abcdef...
148148
/// /ip4/10.0.0.50/tcp/8302/p2p/12D3KooWXYZ9876543210fedcba...
149149
/// /dns4/bootstrap.example.com/tcp/8302/p2p/12D3KooW123ABC...
@@ -160,7 +160,7 @@ pub struct Node {
160160
/// Useful for dynamic peer discovery from a central bootstrap service.
161161
///
162162
/// **Example URL response:**
163-
/// ```
163+
/// ```text
164164
/// /ip4/bootstrap1.example.com/tcp/8302/p2p/12D3KooW...
165165
/// /ip4/bootstrap2.example.com/tcp/8302/p2p/12D3KooX...
166166
/// ```

macros/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ syn = { workspace = true }
1515

1616
[dev-dependencies]
1717
mina-core = { workspace = true }
18+
redux = { workspace = true }
1819
tracing = { workspace = true }
1920
rust-format = { workspace = true, features = ["token_stream"] }
2021
anyhow = { workspace = true }

macros/src/action_event.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,21 @@ For action containers, it simply delegates to inner actions.
66

77
```rust
88
# use mina_core::ActionEvent;
9+
# extern crate redux;
10+
# struct DummyContext {
11+
# time: String,
12+
# node_id: String,
13+
# }
14+
# impl mina_core::log::EventContext for DummyContext {
15+
# fn timestamp(&self) -> redux::Timestamp { mina_core::log::system_time() }
16+
# fn time(&self) -> &dyn tracing::Value { &self.time }
17+
# fn node_id(&self) -> &dyn tracing::Value { &self.node_id }
18+
# fn log_node_id(&self) -> bool { false }
19+
# }
20+
# let context = DummyContext {
21+
# time: "0".to_string(),
22+
# node_id: "test".to_string(),
23+
# };
924
#
1025
#[derive(ActionEvent)]
1126
enum ActionContainer {
@@ -17,10 +32,10 @@ enum Action1 {
1732
Done,
1833
}
1934

20-
ActionContainer::SubAction1(Action1::Init).action_event(context);
35+
ActionContainer::SubAction1(Action1::Init).action_event(&context);
2136
```
2237

23-
```rust
38+
```rust,ignore
2439
impl ActionEvent for ActionContainer {
2540
fn action_event<T>(&self, context: &T)
2641
where T: ActionContext
@@ -61,7 +76,7 @@ pub enum Action {
6176
}
6277
```
6378

64-
```rust
79+
```rust,ignore
6580
impl mina_core::ActionEvent for Action {
6681
fn action_event<T>(&self, context: &T)
6782
where
@@ -97,7 +112,7 @@ pub enum Action {
97112
}
98113
```
99114

100-
```rust
115+
```rust,ignore
101116
impl mina_core::ActionEvent for Action {
102117
fn action_event<T>(&self, context: &T)
103118
where
@@ -132,7 +147,7 @@ pub enum Action {
132147
}
133148
```
134149

135-
```rust
150+
```rust,ignore
136151
impl mina_core::ActionEvent for Action {
137152
fn action_event<T>(&self, context: &T)
138153
where
@@ -156,6 +171,8 @@ a field's enum variant), logging can be delegated to a function implementing
156171
that logic.
157172

158173
```rust
174+
# fn foo<T: mina_core::log::EventContext>(_context: &T) {}
175+
# fn bar<T: mina_core::log::EventContext>(_context: &T, _f1: &bool) {}
159176
#[derive(mina_core::ActionEvent)]
160177
pub enum Action {
161178
#[action_event(expr(foo(context)))]
@@ -165,7 +182,7 @@ pub enum Action {
165182
}
166183
```
167184

168-
```rust
185+
```rust,ignore
169186
impl mina_core::ActionEvent for Action {
170187
fn action_event<T>(&self, context: &T)
171188
where

0 commit comments

Comments
 (0)