M Cargo.lock => Cargo.lock +1 -1
@@ 136,7 136,7 @@ dependencies = [
[[package]]
name = "castor"
-version = "0.8.3"
+version = "0.8.4"
dependencies = [
"ansi-parser 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
M Cargo.toml => Cargo.toml +1 -1
@@ 1,6 1,6 @@
[package]
name = "castor"
-version = "0.8.3"
+version = "0.8.4"
authors = ["Julien Blanchard <julien@typed-hole.org>"]
edition = "2018"
M src/gopher/link.rs => src/gopher/link.rs +8 -8
@@ 108,14 108,6 @@ impl FromStr for Link {
Some(link) => Ok(link),
None => Err(ParseError),
}
- } else if line.contains("://") {
- let url = String::from(line);
- let label = String::from(line);
-
- match make_link(url, label) {
- Some(link) => Ok(link),
- None => Err(ParseError),
- }
} else if line.starts_with('h') {
let label = els.next();
let url = els.next();
@@ 136,6 128,14 @@ impl FromStr for Link {
} else {
Err(ParseError)
}
+ } else if line.contains("://") {
+ let url = String::from(line);
+ let label = String::from(line);
+
+ match make_link(url, label) {
+ Some(link) => Ok(link),
+ None => Err(ParseError),
+ }
} else {
Err(ParseError)
}