[英]How to encode the hex string representation of an account id in Substrate using Rust?
[英]How to exclude the Rust std env when play substrate code in IDE
我使用帶有 Rust 插件的 JetBrains IDE 來運行 Substrate 的代碼。
Substrate 項目通常在文件頂部有一行:
#![cfg_attr(not(feature = "std"), no_std)]
但是,這條線是灰色的,現在是亮黃色,這條線沒有激活,cfg 屬性現在沒有使用。 這意味着開發環境仍在 Rust 標准環境中,我猜。
Substrate 不使用 Rust 標准庫。 所以,我想知道是否可以配置 IDE 來激活基板標准環境,但不能配置 Rust 標准。 這可能對初學者有用,不要包含一些不正確的 func 或 lib。
Substrate 不使用 Rust 標准庫。
這是不對的,我們在為 native 編譯時只是使用普通的std
。 也就是當你編譯節點時。 但是,當我們為wasm
編譯時,我們禁用std
並使用no_std
。
由於我們始終默認啟用std
,因此 IDE 幾乎永遠不會激活no_std
。 所以,我會忽略這個“警告”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.