我试图从Maud重新导出html
宏,但每当我try 使用重新导出的宏时,都会得到一个"未解析的extern crate".
如何从我自己的 crate 重新导出这个宏?
设置
我用的是货运工作区我正在从crate a
重新导出宏,并试图在crate b
中使用它.
代码
我忽略了我认为无关紧要的几行.如果有细节缺失请 comments ,我会添加它们.
Workspace
# Cargo.toml
[workspace]
members = ["a", "b"]
resolver = "2"
[workspace.dependencies]
a = { path = "a" }
maud = "0.26.0"
Crate a
# a/Cargo.toml
[package]
name = "a"
[dependencies]
maud.workspace = true
// a/src/lib.rs
pub use maud::html;
Crate b
# b/Cargo.toml
[package]
name = "b"
[dependencies]
a.workspace = true
// b/src/lib.rs
use a::html;
fn test() {
let markup = html!{ "hello" };
// ^^^^^^^^^^^^^^^^
// unresolved extern crate
// can't find crate for `maud`
}