This prepares a future patch for IncludeMatcher on the road to bare
hg status support.
Details
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Note to reviewers: this stack is part of the larger series of getting a full Rust dirstate.status which is most of the performance hit in bare hg status. More patches are coming, but I figured I would send the patches as I go to help with review timing.
rust/hg-core/src/filepatterns.rs | ||
---|---|---|
455 | I don't see anywhere where this returns None. Should this just be .map() or .flat_map()? | |
461 | I would write this as Some(Ok(match syntax { .. })) as the last expression of this map. Then instead of res.extend() and res.push() you just return the vecs. | |
524 | How about: if !p.is_empty() { p.push(b'/'); } Ok(p) |
rust/hg-core/src/filepatterns.rs | ||
---|---|---|
461 | The match arms would be incompatible. Or maybe I'm missing something. |
rust/hg-core/src/filepatterns.rs | ||
---|---|---|
461 | You would have to make sure you return a Vec on both arms. You will probably want inner_pats.into_iter().collect() on one branch and vec![entry] on the other branch. |
I don't see anywhere where this returns None. Should this just be .map() or .flat_map()?