Skip to content

Add Archive::unpack_mapped#449

Open
RemiBardon wants to merge 2 commits into
composefs:mainfrom
RemiBardon:map-entry-during-unpack
Open

Add Archive::unpack_mapped#449
RemiBardon wants to merge 2 commits into
composefs:mainfrom
RemiBardon:map-entry-during-unpack

Conversation

@RemiBardon
Copy link
Copy Markdown

@RemiBardon RemiBardon commented Apr 19, 2026

(Follow-up to #448, merge first.)

This allows mapping paths while extracting, if #448 gets merged. See this other PR for rationale.

We can discuss implementation, as I’m aware I introduced some genericity which might affect performance / binary size / compile time. There are no benchmarks so I couldn’t know if my changes had an impact. It should not since most people will never use unpack_mapped and _unpack will get monomorphized to the exact same function as before, with the compiler likely optimizing away the newly added line as it’s a no-op. And in the rare case where one needs unpack_mapped, they’d likely have a single call site so unpack_mapped wouldn’t bloat the binary. But that’s just my opinion, I’d get it if you want to use dynamic dispatch instead.

Oh and also feel free to change the method name, I had no inspiration 🙆‍♂️

This allows mapping paths when unpacking an archive.
This allows mapping paths while extracting, if [composefs#448]
gets merged. See the above pull request for rationale regarding this
addition.

[composefs#448]: composefs#448
@RemiBardon
Copy link
Copy Markdown
Author

(FYI I ended up not needing this as I need to iterate over entries myself. You can close this PR if you feel like it’d be too intrusive.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant