zip-rs / zip2

Zip implementation in Rust
Other
98 stars 33 forks source link

Duplicate filename, but what? #127

Open frederikhors opened 4 months ago

frederikhors commented 4 months ago

I'm getting this error:

invalid Zip archive: Duplicate filename

but I cannot understand what is the file duplicated.

Is it possible to write the filename in the error?

Pr0methean commented 4 months ago

Fixing this will require that ZipError::InvalidArchive wrap a Cow<'static, str> rather than &'static str so that it can include a message generated at runtime, but without the overhead of allocating a string at runtime when it's not doing so.

Pr0methean commented 4 months ago

Started work on a solution, but running into some macro errors that I either don't know or have forgotten how to solve.

Rapptz commented 2 months ago

I ran into this issue as well. I'd really like to know what the duplicate is or how to avoid this.

Started work on a solution, but running into some macro errors that I either don't know or have forgotten how to solve.

I think the error you're getting is because you're expanding the argument list into a tuple rather than just letting it expand as arguments to the format! macro.