Skip to content

Commit

Permalink
fix: LineRef is now Copy and remove non-exhaustive
Browse files Browse the repository at this point in the history
After all, this struct refers to what's in a reflog line, which is stable.
  • Loading branch information
Byron committed May 27, 2024
1 parent b29f0d2 commit 21278a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gix-ref/src/store/file/log/line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{log::Line, store_impl::file::log::LineRef};
impl<'a> LineRef<'a> {
/// Convert this instance into its mutable counterpart
pub fn to_owned(&self) -> Line {
self.clone().into()
(*self).into()
}
}

Expand Down
3 changes: 1 addition & 2 deletions gix-ref/src/store/file/log/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ pub mod iter;
mod line;

/// A parsed ref log line.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[non_exhaustive]
pub struct LineRef<'a> {
/// The previous object id in hexadecimal. Use [`LineRef::previous_oid()`] to get a more usable form.
pub previous_oid: &'a BStr,
Expand Down

0 comments on commit 21278a3

Please sign in to comment.