Skip to content

Commit

Permalink
refactor: remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgrayson committed May 5, 2024
1 parent 05977c6 commit 39e1507
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
45 changes: 0 additions & 45 deletions src/ext/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ pub(crate) trait CommitExtended<'a> {
/// guaranteed to have valid UTF-8 name and email strings.
fn author_strict(&self) -> Result<gix::actor::Signature>;

/// Get committer signature, strictly.
///
/// See [`CommitExtended::author_strict()`].
fn committer_strict(&self) -> Result<gix::actor::Signature>;

/// Get commit message with extended capabilities.
fn message_ex(&self) -> Message;

Expand Down Expand Up @@ -76,46 +71,6 @@ impl<'a> CommitExtended<'a> for gix::Commit<'a> {
}
}

fn committer_strict(&self) -> Result<gix::actor::Signature> {
let commit_ref = self.decode()?;
let sig = commit_ref.committer();
let encoding = if let Some(encoding_name) = commit_ref.encoding {
encoding_rs::Encoding::for_label(encoding_name).ok_or_else(|| {
anyhow!(
"unhandled commit encoding `{}` in commit `{}`",
encoding_name.to_str_lossy(),
self.id,
)
})?
} else {
encoding_rs::UTF_8
};

if let Some(name) = encoding.decode_without_bom_handling_and_without_replacement(sig.name) {
if let Some(email) =
encoding.decode_without_bom_handling_and_without_replacement(sig.email)
{
Ok(gix::actor::Signature {
name: BString::from(name.as_ref()),
email: BString::from(email.as_ref()),
time: sig.time,
})
} else {
Err(anyhow!(
"could not decode committer email as `{}` for commit `{}`",
encoding.name(),
self.id,
))
}
} else {
Err(anyhow!(
"could not decode committer name as `{}` for commit `{}`",
encoding.name(),
self.id,
))
}
}

fn message_ex(&self) -> Message {
let commit_ref = self.decode().expect("commit can be decoded");
if let Ok(message) = commit_ref.message.to_str() {
Expand Down
5 changes: 0 additions & 5 deletions src/stack/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ pub(crate) trait StackStateAccess<'repo> {
BothPatches::new(self.applied(), self.unapplied())
}

/// Iterator over unapplied and hidden patch names.
fn unapplied_and_hidden(&self) -> BothPatches<'_> {
BothPatches::new(self.unapplied(), self.hidden())
}

/// Return absolute index of patch in stack.
fn index_of(&self, patchname: &PatchName) -> usize {
self.all_patches()
Expand Down

0 comments on commit 39e1507

Please sign in to comment.