Skip to content

Commit

Permalink
Add Into_inner functions in stead of using as pub
Browse files Browse the repository at this point in the history
  • Loading branch information
kimono-koans committed May 31, 2023
1 parent 7a875cb commit 3f50618
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ pub struct WriteOutBundle {
inner: Vec<RemainderBundle>,
}

impl WriteOutBundle {
fn into_inner(self) -> Vec<RemainderBundle> {
self.inner
}
}

impl From<Vec<RemainderBundle>> for WriteOutBundle {
fn from(vec: Vec<RemainderBundle>) -> Self {
Self { inner: vec }
Expand All @@ -74,7 +80,7 @@ impl Deref for WriteOutBundle {

impl WriteOutBundle {
pub fn write_out(self, config: &Config) -> DanoResult<()> {
self.inner.into_iter().try_for_each(|remainder_bundle| {
self.into_inner().into_iter().try_for_each(|remainder_bundle| {
if !remainder_bundle.files.is_empty() {
remainder_bundle.write_out(config)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ impl FileInfo {
}

fn is_same_filename(&self, file_map: Arc<FileMap>) -> bool {
file_map.inner.contains_key(&self.path)
file_map.deref().contains_key(&self.path)
}

fn is_same_hash(&self, file_map: Arc<FileMap>) -> bool {
Expand Down

0 comments on commit 3f50618

Please sign in to comment.