mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 23:04:17 -05:00
fix: revert from_into test change
This commit is contained in:
parent
8d0aa11a35
commit
c46a711526
1 changed files with 6 additions and 7 deletions
|
@ -43,8 +43,7 @@ impl Default for Person {
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
|
||||||
impl From<&str> for Person {
|
impl From<&str> for Person {
|
||||||
fn from(s: &str) -> Person {
|
fn from(s: &str) -> Person {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -127,14 +126,14 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_trailing_comma() {
|
fn test_trailing_comma() {
|
||||||
let p: Person = Person::from("Mike,32,");
|
let p: Person = Person::from("Mike,32,");
|
||||||
assert_eq!(p.name, "Mike");
|
assert_eq!(p.name, "John");
|
||||||
assert_eq!(p.age, 32);
|
assert_eq!(p.age, 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_trailing_comma_and_some_string() {
|
fn test_trailing_comma_and_some_string() {
|
||||||
let p: Person = Person::from("Mike,32,man");
|
let p: Person = Person::from("Mike,32,dog");
|
||||||
assert_eq!(p.name, "Mike");
|
assert_eq!(p.name, "John");
|
||||||
assert_eq!(p.age, 32);
|
assert_eq!(p.age, 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue