rust/src/compiletest
Eric Kidd c2b0d7dd88 Modify regex::Captures::{at,name} to return Option
Closes #14602.  As discussed in that issue, the existing `at` and `name`
functions represent two different results with the empty string:

1. Matched the empty string.
2. Did not match anything.

Consider the following example.  This regex has two named matched
groups, `key` and `value`. `value` is optional:

```rust
// Matches "foo", "foo;v=bar" and "foo;v=".
regex!(r"(?P<key>[a-z]+)(;v=(?P<value>[a-z]*))?");
```

We can access `value` using `caps.name("value")`, but there's no way for
us to distinguish between the `"foo"` and `"foo;v="` cases.

Early this year, @BurntSushi recommended modifying the existing `at` and
`name` functions to return `Option`, instead of adding new functions to
the API.

This is a [breaking-change], but the fix is easy:

- `refs.at(1)` becomes `refs.at(1).unwrap_or("")`.
- `refs.name(name)` becomes `refs.name(name).unwrap_or("")`.
2014-12-14 08:56:51 -05:00
..
common.rs librustc: Make Copy opt-in. 2014-12-08 13:47:44 -05:00
compiletest.rs Modify regex::Captures::{at,name} to return Option 2014-12-14 08:56:51 -05:00
errors.rs Modify regex::Captures::{at,name} to return Option 2014-12-14 08:56:51 -05:00
header.rs Move FromStr to core::str 2014-11-16 12:41:55 +11:00
procsrv.rs Fallout from renaming 2014-09-16 14:37:48 -07:00
runtest.rs Fixes to the roll-up 2014-11-23 15:23:39 -05:00
util.rs Rename fail! to panic! 2014-10-29 11:43:07 -04:00