Skip to content

Commit a384171

Browse files
author
Linda Goldstein
committed
WIP updating to new rust but getting unexpected panic
1 parent 8b2f508 commit a384171

File tree

2 files changed

+55
-39
lines changed

2 files changed

+55
-39
lines changed

Cargo.lock

Lines changed: 51 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
#![feature(phase)]
2-
#[phase(plugin)]
3-
extern crate regex_macros;
1+
42
extern crate regex;
53

64
extern crate serialize;
75

86
extern crate docopt;
9-
#[phase(plugin)]
10-
extern crate docopt_macros;
7+
#[plugin] #[no_link] extern crate docopt_macros;
118

129
extern crate curl;
1310

@@ -28,7 +25,7 @@ Options:
2825
-d DIR Download location.
2926
-h, --help Show this message.
3027
-v, --verbose Verbose.
31-
")
28+
");
3229

3330
struct MemoryPage
3431
{
@@ -59,7 +56,7 @@ impl Apod {
5956
}
6057

6158
fn get_image_url<'a>(&self, page: &'a MemoryPage) -> Option<&'a str> {
62-
let rex = regex!("<a href=\"(image.*)\"");
59+
let rex = Regex::new("<a href=\"(image.*)\"").unwrap();
6360
let body = str::from_utf8(page.body.as_slice()).unwrap();
6461
match rex.is_match(body) {
6562
true => {

0 commit comments

Comments
 (0)