mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 12:39:42 +00:00
Merge pull request #434 from maorit/fix_type_method
fix typo: 'assotiated' -> 'associated'
This commit is contained in:
@ -195,7 +195,7 @@ struct TrafficLight {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl TrafficLight {
|
impl TrafficLight {
|
||||||
// 1. Implement an assotiated function `new`,
|
// 1. Implement an associated function `new`,
|
||||||
// 2. It will return a TrafficLight contains color "red"
|
// 2. It will return a TrafficLight contains color "red"
|
||||||
// 3. Must use `Self`, DONT use `TrafficLight` in fn signatures or body
|
// 3. Must use `Self`, DONT use `TrafficLight` in fn signatures or body
|
||||||
pub fn new()
|
pub fn new()
|
||||||
|
@ -75,7 +75,7 @@ struct TrafficLight {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl TrafficLight {
|
impl TrafficLight {
|
||||||
// 1. implement a assotiated function `new`,
|
// 1. implement a associated function `new`,
|
||||||
// 2. it will return a TrafficLight contains color "red"
|
// 2. it will return a TrafficLight contains color "red"
|
||||||
// 3. must use `Self`, DONT use `TrafficLight`
|
// 3. must use `Self`, DONT use `TrafficLight`
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
|
Reference in New Issue
Block a user