Use regex 0.2 in build script

This commit is contained in:
messense 2017-05-21 18:08:26 +08:00
parent 3303af9b25
commit c9717249a2
No known key found for this signature in database
GPG Key ID: BB41A8A2C716CCA9
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@ num-traits = "0.1"
pyo3cls = { path = "pyo3cls" }
[build-dependencies]
regex = "0.1"
regex = "0.2"
[features]
default = ["nightly"]

View File

@ -226,8 +226,8 @@ fn get_interpreter_version(line: &str) -> Result<PythonVersion, String> {
let version_re = Regex::new(r"\((\d+), (\d+)\)").unwrap();
match version_re.captures(&line) {
Some(cap) => Ok(PythonVersion {
major: cap.at(1).unwrap().parse().unwrap(),
minor: Some(cap.at(2).unwrap().parse().unwrap())
major: cap.get(1).unwrap().as_str().parse().unwrap(),
minor: Some(cap.get(2).unwrap().as_str().parse().unwrap())
}),
None => Err(
format!("Unexpected response to version query {}", line))