Skip to content

Commit

Permalink
💥 Change SolidEntryBuilder::add_entry argument type impl Entry to…
Browse files Browse the repository at this point in the history
… `RegularEntry`
  • Loading branch information
ChanTsune committed Nov 18, 2023
1 parent 5b797cf commit 05a7a9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cli/src/command/commons.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use crate::cli::{CipherAlgorithmArgs, CompressionAlgorithmArgs};
use libpna::{Entry, EntryBuilder, EntryName, EntryPart, EntryReference, Permission, WriteOption};
use libpna::{
EntryBuilder, EntryName, EntryPart, EntryReference, Permission, RegularEntry, WriteOption,
};
#[cfg(unix)]
use nix::unistd::{Group, User};
use std::fs::metadata;
Expand Down Expand Up @@ -49,7 +51,7 @@ pub(crate) fn create_entry(
option: WriteOption,
keep_timestamp: bool,
keep_permission: bool,
) -> io::Result<impl Entry> {
) -> io::Result<RegularEntry> {
if path.is_symlink() {
let source = fs::read_link(path)?;
let entry = EntryBuilder::new_symbolic_link(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/archive/entry/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl SolidEntriesBuilder {
/// ```
#[deprecated(since = "0.3.3", note = "Use `SolidEntryBuilder::add_entry` instead.")]
pub fn add_entry(&mut self, entry: impl Entry) -> io::Result<()> {
self.0.add_entry(entry)
self.0.data.write_all(&entry.into_bytes())
}

/// Builds the solid archive as a [SolidEntries].
Expand Down Expand Up @@ -361,7 +361,7 @@ impl SolidEntryBuilder {
/// # Ok(())
/// # }
/// ```
pub fn add_entry(&mut self, entry: impl Entry) -> io::Result<()> {
pub fn add_entry(&mut self, entry: RegularEntry) -> io::Result<()> {
self.data.write_all(&entry.into_bytes())
}

Expand Down

0 comments on commit 05a7a9a

Please sign in to comment.