summaryrefslogtreecommitdiffstats
path: root/vendor/gix-pack/src/data/output
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gix-pack/src/data/output')
-rw-r--r--vendor/gix-pack/src/data/output/count/mod.rs4
-rw-r--r--vendor/gix-pack/src/data/output/count/objects/types.rs15
-rw-r--r--vendor/gix-pack/src/data/output/count/objects/util.rs2
-rw-r--r--vendor/gix-pack/src/data/output/entry/iter_from_counts.rs6
-rw-r--r--vendor/gix-pack/src/data/output/entry/mod.rs4
-rw-r--r--vendor/gix-pack/src/data/output/mod.rs4
6 files changed, 15 insertions, 20 deletions
diff --git a/vendor/gix-pack/src/data/output/count/mod.rs b/vendor/gix-pack/src/data/output/count/mod.rs
index e7ee767de..bec75d6f3 100644
--- a/vendor/gix-pack/src/data/output/count/mod.rs
+++ b/vendor/gix-pack/src/data/output/count/mod.rs
@@ -4,7 +4,7 @@ use crate::data::output::Count;
/// Specifies how the pack location was handled during counting
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum PackLocation {
/// We did not lookup this object
NotLookedUp,
@@ -30,7 +30,7 @@ impl PackLocation {
}
impl Count {
- /// Create a new instance from the given `oid` and its corresponding git `obj`ect data.
+ /// Create a new instance from the given `oid` and its corresponding location.
pub fn from_data(oid: impl Into<ObjectId>, location: Option<crate::data::entry::Location>) -> Self {
Count {
id: oid.into(),
diff --git a/vendor/gix-pack/src/data/output/count/objects/types.rs b/vendor/gix-pack/src/data/output/count/objects/types.rs
index 8c8c939df..cd9e92c7a 100644
--- a/vendor/gix-pack/src/data/output/count/objects/types.rs
+++ b/vendor/gix-pack/src/data/output/count/objects/types.rs
@@ -1,6 +1,6 @@
/// Information gathered during the run of [`iter_from_objects()`][super::objects()].
#[derive(Default, PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Outcome {
/// The amount of objects provided to start the iteration.
pub input_objects: usize,
@@ -32,10 +32,11 @@ impl Outcome {
}
/// The way input objects are handled
-#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[derive(Default, PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum ObjectExpansion {
/// Don't do anything with the input objects except for transforming them into pack entries
+ #[default]
AsIs,
/// If the input object is a Commit then turn it into a pack entry. Additionally obtain its tree, turn it into a pack entry
/// along with all of its contents, that is nested trees, and any other objects reachable from it.
@@ -52,15 +53,9 @@ pub enum ObjectExpansion {
TreeAdditionsComparedToAncestor,
}
-impl Default for ObjectExpansion {
- fn default() -> Self {
- ObjectExpansion::AsIs
- }
-}
-
/// Configuration options for the pack generation functions provided in [this module][crate::data::output].
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Options {
/// The amount of threads to use at most when resolving the pack. If `None`, all logical cores are used.
/// If more than one thread is used, the order of returned [counts][crate::data::output::Count] is not deterministic anymore
diff --git a/vendor/gix-pack/src/data/output/count/objects/util.rs b/vendor/gix-pack/src/data/output/count/objects/util.rs
index a80841313..b1997e1c7 100644
--- a/vendor/gix-pack/src/data/output/count/objects/util.rs
+++ b/vendor/gix-pack/src/data/output/count/objects/util.rs
@@ -3,9 +3,9 @@ pub trait InsertImmutable {
}
mod trait_impls {
- use gix_hash::ObjectId;
use std::cell::RefCell;
+ use gix_hash::ObjectId;
use gix_hashtable::HashSet;
use super::InsertImmutable;
diff --git a/vendor/gix-pack/src/data/output/entry/iter_from_counts.rs b/vendor/gix-pack/src/data/output/entry/iter_from_counts.rs
index 25e256d5c..dbe8b0b95 100644
--- a/vendor/gix-pack/src/data/output/entry/iter_from_counts.rs
+++ b/vendor/gix-pack/src/data/output/entry/iter_from_counts.rs
@@ -317,7 +317,7 @@ mod types {
/// Information gathered during the run of [`iter_from_counts()`][crate::data::output::entry::iter_from_counts()].
#[derive(Default, PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
- #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+ #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Outcome {
/// The amount of fully decoded objects. These are the most expensive as they are fully decoded.
pub decoded_and_recompressed_objects: usize,
@@ -349,7 +349,7 @@ mod types {
/// The way the iterator operates.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
- #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+ #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Mode {
/// Copy base objects and deltas from packs, while non-packed objects will be treated as base objects
/// (i.e. without trying to delta compress them). This is a fast way of obtaining a back while benefiting
@@ -360,7 +360,7 @@ mod types {
/// Configuration options for the pack generation functions provided in [`iter_from_counts()`][crate::data::output::entry::iter_from_counts()].
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
- #[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+ #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Options {
/// The amount of threads to use at most when resolving the pack. If `None`, all logical cores are used.
pub thread_limit: Option<usize>,
diff --git a/vendor/gix-pack/src/data/output/entry/mod.rs b/vendor/gix-pack/src/data/output/entry/mod.rs
index 401d2f24c..a94720047 100644
--- a/vendor/gix-pack/src/data/output/entry/mod.rs
+++ b/vendor/gix-pack/src/data/output/entry/mod.rs
@@ -10,7 +10,7 @@ pub use iter_from_counts::function::iter_from_counts;
/// The kind of pack entry to be written
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Kind {
/// A complete base object, including its kind
Base(gix_object::Kind),
@@ -126,7 +126,7 @@ impl output::Entry {
})
}
- /// Create a new instance from the given `oid` and its corresponding git `obj`ect data.
+ /// Create a new instance from the given `oid` and its corresponding git object data `obj`.
pub fn from_data(count: &output::Count, obj: &gix_object::Data<'_>) -> Result<Self, Error> {
Ok(output::Entry {
id: count.id.to_owned(),
diff --git a/vendor/gix-pack/src/data/output/mod.rs b/vendor/gix-pack/src/data/output/mod.rs
index f94d32e8e..338bb92b3 100644
--- a/vendor/gix-pack/src/data/output/mod.rs
+++ b/vendor/gix-pack/src/data/output/mod.rs
@@ -8,7 +8,7 @@ pub mod count;
/// One can expect to have one of these in memory when building big objects, so smaller is better here.
/// They should contain everything of importance to generate a pack as fast as possible.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Count {
/// The hash of the object to write
pub id: ObjectId,
@@ -21,7 +21,7 @@ pub struct Count {
/// Some of these will be in-flight and in memory while waiting to be written. Memory requirements depend on the amount of compressed
/// data they hold.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
-#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
+#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct Entry {
/// The hash of the object to write
pub id: ObjectId,