mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-09-29 02:03:29 +00:00
modules2: obey name convention for reexported consts
Clippy doesn't warn against this, but a reexport should probably obey the same naming convention as the item it is a reexport of.
This commit is contained in:
@@ -20,7 +20,7 @@ mod delicious_snacks {
|
|||||||
fn main() {
|
fn main() {
|
||||||
println!(
|
println!(
|
||||||
"favorite snacks: {} and {}",
|
"favorite snacks: {} and {}",
|
||||||
delicious_snacks::fruit,
|
delicious_snacks::FRUIT,
|
||||||
delicious_snacks::veggie,
|
delicious_snacks::VEGGIE,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
mod delicious_snacks {
|
mod delicious_snacks {
|
||||||
// Added `pub` and used the expected alias after `as`.
|
// Added `pub` and used the expected alias after `as`.
|
||||||
pub use self::fruits::PEAR as fruit;
|
pub use self::fruits::PEAR as FRUIT;
|
||||||
pub use self::veggies::CUCUMBER as veggie;
|
pub use self::veggies::CUCUMBER as VEGGIE;
|
||||||
|
|
||||||
mod fruits {
|
mod fruits {
|
||||||
pub const PEAR: &str = "Pear";
|
pub const PEAR: &str = "Pear";
|
||||||
@@ -17,7 +17,7 @@ mod delicious_snacks {
|
|||||||
fn main() {
|
fn main() {
|
||||||
println!(
|
println!(
|
||||||
"favorite snacks: {} and {}",
|
"favorite snacks: {} and {}",
|
||||||
delicious_snacks::fruit,
|
delicious_snacks::FRUIT,
|
||||||
delicious_snacks::veggie,
|
delicious_snacks::VEGGIE,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user