mirror of
https://git.proxmox.com/git/pathpatterns
synced 2026-01-06 00:08:41 +00:00
Updated `matches()` function, which now takes the `GetFileMode` trait and returns a Result. `GetFileMode` is a function that should return the `file_mode`. `matches()` will go through the patterns and match by path only until it finds a pattern which does not have `MatchFlag::ANY_FILE_TYPE`, in case it will call the `get_file_mode`, which will return a `file_mode`. This will ensure that the `get()` (which in our case executes `stat()`) will only be run once(at most), every pattern will only be processed once and that the order of the patterns will be respected. `GetFileMode` is also implemented for `Option<u32>` (so that we can simply pass options of the `file_mode`) and `u32` (returning `std::convert::Infallible`, so that we can pass a u32 mode directly). Signed-off-by: Gabriel Goller <g.goller@proxmox.com> |
||
|---|---|---|
| .cargo | ||
| debian | ||
| src | ||
| .gitignore | ||
| Cargo.toml | ||
| Makefile | ||