diff options
| author | Philipp A | 2018-12-02 14:52:59 +0100 |
|---|---|---|
| committer | Philipp A | 2018-12-02 14:52:59 +0100 |
| commit | be2ecdc0985dec17e5563791cb171e22f19b75b3 (patch) | |
| tree | 9e82669d46a8cc4e2ce1d5e0a25df4c8903e60f0 | |
| parent | fad2dff1c719470a4ed8542b05a210056de6949a (diff) | |
| download | rust-rst-be2ecdc0985dec17e5563791cb171e22f19b75b3.tar.bz2 | |
Improve target
| -rw-r--r-- | src/target.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/target.rs b/src/target.rs index 2752097..9bfd216 100644 --- a/src/target.rs +++ b/src/target.rs @@ -7,6 +7,7 @@ use serde_derive::Serialize; #[derive(Debug, Serialize)] +#[serde(untagged)] pub enum Target { #[serde(serialize_with = "serialize_url")] Url(Url), @@ -31,7 +32,7 @@ impl FromStr for Target { fn from_str(input: &str) -> Result<Self, Self::Err> { Ok(match Url::parse(input) { Ok(url) => url.into(), - Err(_) => PathBuf::from(input).into(), + Err(_) => PathBuf::from(input.trim()).into(), }) } } |
