summaryrefslogtreecommitdiffstats
path: root/vendor/gix-odb/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:36 +0000
commite02c5b5930c2c9ba3e5423fe12e2ef0155017297 (patch)
treefd60ebbbb5299e16e5fca8c773ddb74f764760db /vendor/gix-odb/src/lib.rs
parentAdding debian version 1.73.0+dfsg1-1. (diff)
downloadrustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.tar.xz
rustc-e02c5b5930c2c9ba3e5423fe12e2ef0155017297.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-odb/src/lib.rs')
-rw-r--r--vendor/gix-odb/src/lib.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/vendor/gix-odb/src/lib.rs b/vendor/gix-odb/src/lib.rs
index e0beac548..5aee76ca2 100644
--- a/vendor/gix-odb/src/lib.rs
+++ b/vendor/gix-odb/src/lib.rs
@@ -76,6 +76,12 @@ mod traits;
pub use traits::{Find, FindExt, Header, HeaderExt, Write};
+///
+pub mod write {
+ /// The error type returned by the [`Write`](crate::Write) trait.
+ pub type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
+}
+
/// A thread-local handle to access any object.
pub type Handle = Cache<store::Handle<OwnShared<Store>>>;
/// A thread-local handle to access any object, but thread-safe and independent of the actual type of `OwnShared` or feature toggles in `gix-features`.
@@ -142,11 +148,16 @@ pub fn at_opts(
replacements: impl IntoIterator<Item = (gix_hash::ObjectId, gix_hash::ObjectId)>,
options: store::init::Options,
) -> std::io::Result<Handle> {
- let handle = OwnShared::new(Store::at_opts(objects_dir, replacements, options)?).to_handle();
+ let handle = OwnShared::new(Store::at_opts(
+ objects_dir.into(),
+ &mut replacements.into_iter(),
+ options,
+ )?)
+ .to_handle();
Ok(Cache::from(handle))
}
/// Create a new cached handle to the object store.
pub fn at(objects_dir: impl Into<PathBuf>) -> std::io::Result<Handle> {
- at_opts(objects_dir, Vec::new().into_iter(), Default::default())
+ at_opts(objects_dir, Vec::new(), Default::default())
}