| @@ -9,7 +9,7 @@ use crate::store::handle; · 8 unmodified lines |
| 9 | 9 | mod error { |
| 10 | 10 | use crate::{loose, pack}; |
| 11 | 11 | |
| 12 | | − /// Returned by [`Handle::try_find()`][crate::pack::Find::try_find()] |
| 12 | + /// Returned by [`Handle::try_find()`][git_pack::Find::try_find()] |
| 13 | 13 | #[derive(thiserror::Error, Debug)] |
| 14 | 14 | #[allow(missing_docs)] |
| 15 | 15 | pub enum Error { |
| @@ -27,7 +27,7 @@ pub use error::Error; · 11 unmodified lines |
| 27 | 27 | |
| 28 | 28 | use crate::store::types::PackId; |
| 29 | 29 | |
| 30 | | −impl<S> crate::pack::Find for super::Handle<S> |
| 30 | +impl<S> git_pack::Find for super::Handle<S> |
| 31 | 31 | where |
| 32 | 32 | S: Deref<Target = super::Store> + Clone, |
| 33 | 33 | { |
| @@ -304,3 +304,19 @@ where · 270 unmodified lines |
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | } |
| 307 | + |
| 308 | +impl<S> crate::Find for super::Handle<S> |
| 309 | +where |
| 310 | + S: Deref<Target = super::Store> + Clone, |
| 311 | + Self: git_pack::Find, |
| 312 | +{ |
| 313 | + type Error = <Self as git_pack::Find>::Error; |
| 314 | + |
| 315 | + fn contains(&self, id: impl AsRef<oid>) -> bool { |
| 316 | + git_pack::Find::contains(self, id) |
| 317 | + } |
| 318 | + |
| 319 | + fn try_find<'a>(&self, id: impl AsRef<oid>, buffer: &'a mut Vec<u8>) -> Result<Option<Data<'a>>, Self::Error> { |
| 320 | + git_pack::Find::try_find(self, id, buffer).map(|t| t.map(|t| t.0)) |
| 321 | + } |
| 322 | +} |