Skip to content

Commit 1914775

Browse files
authored
Make simple-mermaid optional (#2878)
This prevents it leaking `std` into `no_std` builds. Closes: #2866
1 parent 5daef5d commit 1914775

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

substrate/frame/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ frame-executive = { default-features = false, path = "../frame/executive", optio
4848
frame-system-rpc-runtime-api = { default-features = false, path = "../frame/system/rpc/runtime-api", optional = true }
4949

5050
docify = "0.2.0"
51-
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev = "e48b187bcfd5cc75111acd9d241f1bd36604344b" }
51+
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev = "e48b187bcfd5cc75111acd9d241f1bd36604344b", optional = true }
5252
log = { version = "0.4.20", default-features = false }
5353

5454
[dev-dependencies]
@@ -78,6 +78,7 @@ std = [
7878
"log/std",
7979
"parity-scale-codec/std",
8080
"scale-info/std",
81+
"simple-mermaid",
8182
"sp-api?/std",
8283
"sp-arithmetic/std",
8384
"sp-block-builder?/std",

substrate/primitives/runtime/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sp-std = { path = "../std", default-features = false }
3434
sp-weights = { path = "../weights", default-features = false }
3535
docify = { version = "0.2.6" }
3636

37-
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev = "e48b187bcfd5cc75111acd9d241f1bd36604344b" }
37+
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", rev = "e48b187bcfd5cc75111acd9d241f1bd36604344b", optional = true }
3838

3939
[dev-dependencies]
4040
rand = "0.8.5"
@@ -57,6 +57,7 @@ std = [
5757
"rand",
5858
"scale-info/std",
5959
"serde/std",
60+
"simple-mermaid",
6061
"sp-api/std",
6162
"sp-application-crypto/std",
6263
"sp-arithmetic/std",

substrate/primitives/runtime/src/generic/unchecked_extrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type UncheckedSignaturePayload<Address, Signature, Extra> = (Address, Signature,
5757
/// could in principle be any other interaction. Transactions are either signed or unsigned. A
5858
/// sensible transaction pool should ensure that only transactions that are worthwhile are
5959
/// considered for block-building.
60-
#[doc = simple_mermaid::mermaid!("../../../../../docs/mermaid/extrinsics.mmd")]
60+
#[cfg_attr(feature = "std", doc = simple_mermaid::mermaid!("../../../../../docs/mermaid/extrinsics.mmd"))]
6161
/// This type is by no means enforced within Substrate, but given its genericness, it is highly
6262
/// likely that for most use-cases it will suffice. Thus, the encoding of this type will dictate
6363
/// exactly what bytes should be sent to a runtime to transact with it.

0 commit comments

Comments
 (0)