mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-22 23:10:20 +08:00
补充章节7.3中示例代码的注释翻译 (#120)
This commit is contained in:
parent
21cf58a9e7
commit
2955e9e11c
@ -5,9 +5,9 @@ mod front_of_house {
|
||||
}
|
||||
|
||||
pub fn eat_at_restaurant() {
|
||||
// Absolute path
|
||||
// 绝对路径
|
||||
crate::front_of_house::hosting::add_to_waitlist();
|
||||
|
||||
// Relative path
|
||||
// 相对路径
|
||||
front_of_house::hosting::add_to_waitlist();
|
||||
}
|
||||
|
@ -5,9 +5,9 @@ mod front_of_house {
|
||||
}
|
||||
|
||||
pub fn eat_at_restaurant() {
|
||||
// Absolute path
|
||||
// 绝对路径
|
||||
crate::front_of_house::hosting::add_to_waitlist();
|
||||
|
||||
// Relative path
|
||||
// 相对路径
|
||||
front_of_house::hosting::add_to_waitlist();
|
||||
}
|
||||
|
@ -5,9 +5,9 @@ mod front_of_house {
|
||||
}
|
||||
|
||||
pub fn eat_at_restaurant() {
|
||||
// Absolute path
|
||||
// 绝对路径
|
||||
crate::front_of_house::hosting::add_to_waitlist();
|
||||
|
||||
// Relative path
|
||||
// 相对路径
|
||||
front_of_house::hosting::add_to_waitlist();
|
||||
}
|
||||
|
@ -15,13 +15,13 @@ mod back_of_house {
|
||||
}
|
||||
|
||||
pub fn eat_at_restaurant() {
|
||||
// Order a breakfast in the summer with Rye toast
|
||||
// 在夏天点一份黑麦面包作为早餐
|
||||
let mut meal = back_of_house::Breakfast::summer("Rye");
|
||||
// Change our mind about what bread we'd like
|
||||
// 更改我们想要的面包
|
||||
meal.toast = String::from("Wheat");
|
||||
println!("I'd like {} toast please", meal.toast);
|
||||
|
||||
// The next line won't compile if we uncomment it; we're not allowed
|
||||
// to see or modify the seasonal fruit that comes with the meal
|
||||
// 如果取消下一行的注释,将会导致编译失败;我们不被允许
|
||||
// 看到或更改随餐搭配的季节水果
|
||||
// meal.seasonal_fruit = String::from("blueberries");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user