Skip to content

Commit cd969f6

Browse files
committed
fix: LineRef is now Copy and remove non-exhaustive
After all, this struct refers to what's in a reflog line, which is stable.
1 parent e8b6bc2 commit cd969f6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

gix-ref/src/store/file/log/line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{log::Line, store_impl::file::log::LineRef};
55
impl<'a> LineRef<'a> {
66
/// Convert this instance into its mutable counterpart
77
pub fn to_owned(&self) -> Line {
8-
self.clone().into()
8+
(*self).into()
99
}
1010
}
1111

gix-ref/src/store/file/log/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ pub mod iter;
88
mod line;
99

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

0 commit comments

Comments
 (0)