Skip to content

Commit

Permalink
Auto merge of #361 - rap2hpoutre:patch-1, r=BurntSushi
Browse files Browse the repository at this point in the history
Fix example in documentation

see #359

I choose to write:

```rust
assert_eq!("2010".to_string(), caps["year"]);
```

But I could have choose:

```rust
assert_eq!("2010", &caps["year"]);
```

Not sure which one is the best (maybe none of them)
  • Loading branch information
bors committed May 10, 2017
2 parents 3757bbf + b9ac569 commit e9f8318
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ fn main() {
").unwrap();
let caps = re.captures("2010-03-14").unwrap();

assert_eq!("2010", caps["year"]);
assert_eq!("03", caps["month"]);
assert_eq!("14", caps["day"]);
assert_eq!("2010", &caps["year"]);
assert_eq!("03", &caps["month"]);
assert_eq!("14", &caps["day"]);
}
```

Expand Down

0 comments on commit e9f8318

Please sign in to comment.