Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Rust
/
Modules and crates
A package named store-domain has src/lib.rs and src/main.rs. From main.rs, how should the…
from Modules and crates
Rust 1.98
intermediate
1 min
A package named store-domain has src/lib.rs and src/main.rs. From main.rs, how should the binary normally import Product exposed by the library root?
use store_domain::Product;
use crate::Product;
use src::lib::Product;
mod lib; use lib::Product;
Check
Ask AI about this kata
Report an error
next kata
Which statement correctly distinguishes a Cargo package, a crate, and a module?
Quiz
A new version is available
Reload