use failure::Error instead of hyper::error::UriError

This commit is contained in:
Paul Woolcock 2018-02-12 22:32:54 -05:00
parent 60b2e2096e
commit 161e29e6d6

View file

@ -1,3 +1,4 @@
use failure::Error;
use hyper::Uri; use hyper::Uri;
use relative_path::RelativePathBuf; use relative_path::RelativePathBuf;
@ -5,13 +6,13 @@ use ::models::repo::RepoPath;
const BITBUCKET_USER_CONTENT_BASE_URI: &'static str = "https://bitbucket.org"; const BITBUCKET_USER_CONTENT_BASE_URI: &'static str = "https://bitbucket.org";
pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result<Uri, ::hyper::error::UriError> { pub fn get_manifest_uri(repo_path: &RepoPath, path: &RelativePathBuf) -> Result<Uri, Error> {
let path_str: &str = path.as_ref(); let path_str: &str = path.as_ref();
format!("{}/{}/{}/raw/master/{}", Ok(format!("{}/{}/{}/raw/master/{}",
BITBUCKET_USER_CONTENT_BASE_URI, BITBUCKET_USER_CONTENT_BASE_URI,
repo_path.qual.as_ref(), repo_path.qual.as_ref(),
repo_path.name.as_ref(), repo_path.name.as_ref(),
path_str path_str
).parse::<Uri>() ).parse::<Uri>()?)
} }