[Updated] D10142: rhg: `cat` command: print error messages for missing files

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Wed Mar 10 09:23:06 UTC 2021


This revision now requires changes to proceed.
Alphare added inline comments.
Alphare requested changes to this revision.

INLINE COMMENTS

> cat.rs:20
>  
> +pub struct CatOutput {
> +    pub found_any: bool,

Could you add a simple one-line docstring to the fields?

> cat.rs:82
>  
> -    Ok(bytes)
> +    let missing: Vec<_> = files
> +        .iter()

This seems wasteful because it's always looping over all files, the happy path should be as fast as possible. Should we simply populate a `Vec` with files that don't match anything?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10142/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D10142

To: SimonSapin, #hg-reviewers, marmoute, Alphare
Cc: Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210310/683e94b4/attachment-0002.html>


More information about the Mercurial-patches mailing list