mirror of
https://github.com/deps-rs/deps.rs.git
synced 2024-11-22 18:36:30 +00:00
use failure::Error instead of hyper::error::UriError
This commit is contained in:
parent
60b2e2096e
commit
161e29e6d6
1 changed files with 4 additions and 3 deletions
|
@ -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>()?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue