Skip to content

Commit 6272040

Browse files
committed
refactor(api): demote internal types to pub(crate)
- SymbolChangeType: pub -> pub(crate), add #[non_exhaustive] - change_type(): pub -> pub(crate) - GitService: pub -> pub(crate) - Progress: pub -> pub(crate)
1 parent 0759724 commit 6272040

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/domain/symbol.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ pub enum SymbolKind {
2121

2222
/// How a symbol was affected by the change.
2323
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
24+
#[non_exhaustive]
2425
#[allow(dead_code)]
25-
pub enum SymbolChangeType {
26+
pub(crate) enum SymbolChangeType {
2627
/// Symbol only exists in staged content (new symbol)
2728
Added,
2829
/// Symbol only exists in HEAD content (removed symbol)
@@ -57,7 +58,7 @@ impl CodeSymbol {
5758
/// Determine the change type for this symbol.
5859
#[must_use]
5960
#[allow(dead_code)]
60-
pub fn change_type(&self) -> SymbolChangeType {
61+
pub(crate) fn change_type(&self) -> SymbolChangeType {
6162
match (self.is_added, self.is_whitespace_only) {
6263
(true, None) => SymbolChangeType::Added,
6364
(false, None) => SymbolChangeType::Removed,

src/services/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use tokio::process::Command;
1111
use crate::domain::{ChangeStatus, DiffStats, FileCategory, FileChange, StagedChanges};
1212
use crate::error::{Error, Result};
1313

14-
pub struct GitService {
14+
pub(crate) struct GitService {
1515
repo: gix::Repository,
1616
work_dir: PathBuf,
1717
}

src/services/progress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use indicatif::{ProgressBar, ProgressStyle};
1111
///
1212
/// Suppressed automatically in non-TTY environments (pipes, git hooks).
1313
/// Falls back to simple status messages when indicatif is not appropriate.
14-
pub struct Progress {
14+
pub(crate) struct Progress {
1515
bar: Option<ProgressBar>,
1616
}
1717

0 commit comments

Comments
 (0)