Use Vec<String> for files list rather than Vec<&str> to simplify code
This commit is contained in:
parent
d303eb0390
commit
04d2fb2bf4
@ -31,7 +31,7 @@ pub use {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Creates a haggis archive from a list of files
|
/// Creates a haggis archive from a list of files
|
||||||
pub fn create_archive(path: &str, files: Vec<&str>, algorithm: Algorithm) -> Result<(), Error> {
|
pub fn create_archive(path: &str, files: Vec<String>, algorithm: Algorithm) -> Result<(), Error> {
|
||||||
let fd = fs::OpenOptions::new()
|
let fd = fs::OpenOptions::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
.truncate(true)
|
.truncate(true)
|
||||||
@ -44,7 +44,7 @@ pub fn create_archive(path: &str, files: Vec<&str>, algorithm: Algorithm) -> Res
|
|||||||
/// Streams a haggis archive over something which implements `Write`
|
/// Streams a haggis archive over something which implements `Write`
|
||||||
pub fn stream_archive<W: Write>(
|
pub fn stream_archive<W: Write>(
|
||||||
mut writer: W,
|
mut writer: W,
|
||||||
files: Vec<&str>,
|
files: Vec<String>,
|
||||||
algorithm: Algorithm,
|
algorithm: Algorithm,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let links = Mutex::new(HashMap::new());
|
let links = Mutex::new(HashMap::new());
|
||||||
@ -69,7 +69,7 @@ pub enum Message {
|
|||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
pub fn par_create_archive(
|
pub fn par_create_archive(
|
||||||
path: &str,
|
path: &str,
|
||||||
files: Vec<&str>,
|
files: Vec<String>,
|
||||||
algorithm: Algorithm,
|
algorithm: Algorithm,
|
||||||
sender: &Sender<Message>,
|
sender: &Sender<Message>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
@ -83,7 +83,7 @@ pub fn par_create_archive(
|
|||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
pub fn par_stream_archive<W: Write + Send>(
|
pub fn par_stream_archive<W: Write + Send>(
|
||||||
writer: W,
|
writer: W,
|
||||||
files: Vec<&str>,
|
files: Vec<String>,
|
||||||
algorithm: Algorithm,
|
algorithm: Algorithm,
|
||||||
sender: &Sender<Message>,
|
sender: &Sender<Message>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
Loading…
Reference in New Issue
Block a user