Merge pull request #892 from matthiasbeyer/remove-warnings
Remove warnings
This commit is contained in:
commit
3ffedec8b8
4 changed files with 8 additions and 7 deletions
|
@ -49,7 +49,7 @@ pub mod iter {
|
||||||
|
|
||||||
impl<I: Iterator<Item = Entry>> ToHtmlIterator<I> {
|
impl<I: Iterator<Item = Entry>> ToHtmlIterator<I> {
|
||||||
|
|
||||||
fn new(i: I) -> ToHtmlIterator<I> {
|
pub fn new(i: I) -> ToHtmlIterator<I> {
|
||||||
ToHtmlIterator { i: i }
|
ToHtmlIterator { i: i }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ pub mod iter {
|
||||||
|
|
||||||
impl<I: Iterator<Item = Entry>> WithHtmlIterator<I> {
|
impl<I: Iterator<Item = Entry>> WithHtmlIterator<I> {
|
||||||
|
|
||||||
fn new(i: I) -> WithHtmlIterator<I> {
|
pub fn new(i: I) -> WithHtmlIterator<I> {
|
||||||
WithHtmlIterator { i: i }
|
WithHtmlIterator { i: i }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ pub struct Link {
|
||||||
impl Link {
|
impl Link {
|
||||||
|
|
||||||
/// Translate a `Link` into a `UrlLink`
|
/// Translate a `Link` into a `UrlLink`
|
||||||
fn into_urllink(self) -> Result<UrlLink> {
|
pub fn into_urllink(self) -> Result<UrlLink> {
|
||||||
Url::parse(&self.link[..])
|
Url::parse(&self.link[..])
|
||||||
.map(move |link| UrlLink { title: self.title, link: link, })
|
.map(move |link| UrlLink { title: self.title, link: link, })
|
||||||
.map_err(Box::new)
|
.map_err(Box::new)
|
||||||
|
|
|
@ -226,6 +226,7 @@ macro_rules! generate_error_types {
|
||||||
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
#[allow(dead_code)]
|
||||||
mod test {
|
mod test {
|
||||||
|
|
||||||
generate_error_module!(
|
generate_error_module!(
|
||||||
|
|
|
@ -137,22 +137,22 @@ impl<'a> Ref<'a> {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok((file, opt_contenthash, opt_permissions))
|
Ok((opt_contenthash, opt_permissions))
|
||||||
})
|
})
|
||||||
|
|
||||||
// and then we try to canonicalize the PathBuf, because we want to store a
|
// and then we try to canonicalize the PathBuf, because we want to store a
|
||||||
// canonicalized path
|
// canonicalized path
|
||||||
// and return (file, content hash, permissions, canonicalized path)
|
// and return (file, content hash, permissions, canonicalized path)
|
||||||
.and_then(|(file, opt_contenthash, opt_permissions)| {
|
.and_then(|(opt_contenthash, opt_permissions)| {
|
||||||
pb.canonicalize()
|
pb.canonicalize()
|
||||||
.map(|can| (file, opt_contenthash, opt_permissions, can))
|
.map(|can| (opt_contenthash, opt_permissions, can))
|
||||||
// if PathBuf::canonicalize() failed, build an error from the return value
|
// if PathBuf::canonicalize() failed, build an error from the return value
|
||||||
.map_err(|e| REK::PathCanonicalizationError.into_error_with_cause(Box::new(e)))
|
.map_err(|e| REK::PathCanonicalizationError.into_error_with_cause(Box::new(e)))
|
||||||
})
|
})
|
||||||
|
|
||||||
// and then we hash the canonicalized path
|
// and then we hash the canonicalized path
|
||||||
// and return (file, content hash, permissions, canonicalized path, path hash)
|
// and return (file, content hash, permissions, canonicalized path, path hash)
|
||||||
.and_then(|(file, opt_contenthash, opt_permissions, can)| {
|
.and_then(|(opt_contenthash, opt_permissions, can)| {
|
||||||
let path_hash = try!(Ref::hash_path(&can)
|
let path_hash = try!(Ref::hash_path(&can)
|
||||||
.map_err(Box::new)
|
.map_err(Box::new)
|
||||||
.map_err(|e| REK::PathHashingError.into_error_with_cause(e))
|
.map_err(|e| REK::PathHashingError.into_error_with_cause(e))
|
||||||
|
|
Loading…
Reference in a new issue