• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kbknapp / clap-rs / 3326
94%

Build:
DEFAULT BRANCH: master
Ran 22 May 2017 10:41PM UTC
Jobs 1
Files 63
Run time 4s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
3326

Pull #845

travis-ci

web-flow
feature: use textwrap crate for wrapping help texts

The textwrap crate uses a simpler linear-time algorithm for wrapping
the text. The current algorithm in wrap_help uses several O(n) calls
to String::insert and String::remove, which makes it potentially
quadratic in complexity.

... benchcmp

Notice how the wrapping_newline_chars test was updated -- the old
algorithm had a subtle bug where it would break lines too early. That
is, it wrapped the text like

    ARGS:
        <mode>    x, max, maximum   20 characters, contains
                  symbols.
                  l, long           Copy-friendly,
                  14 characters, contains symbols.
                  m, med, medium    Copy-friendly, 8
                  characters, contains symbols.";

when it should really have wrapped it like

    ARGS:
        <mode>    x, max, maximum   20 characters, contains
                  symbols.
                  l, long           Copy-friendly, 14
                  characters, contains symbols.
                  m, med, medium    Copy-friendly, 8
                  characters, contains symbols.";

Notice how the word "14" was incorrectly moved to the next line. There
is clearly room for the word on the line with the "l, long" option
since there is room for "contains" just above it.

The algorithm in textwrap handles this case correctly.
Pull Request #845: Use my textwrap crate for wrapping help texts

9 of 9 new or added lines in 2 files covered. (100.0%)

7974 of 8656 relevant lines covered (92.12%)

0.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
100.0
tests/help.rs

Coverage Regressions

Lines Coverage ∆ File
18
100.0
tests/utf8.rs
10
100.0
src/app/parser.rs
5
100.0
src/macros.rs
5
100.0
src/args/arg.rs
4
100.0
src/app/macros.rs
3
100.0
src/app/help.rs
3
100.0
src/app/usage.rs
3
100.0
src/errors.rs
1
100.0
src/suggestions.rs
1
100.0
src/args/macros.rs
1
100.0
src/app/validator.rs
1
100.0
src/completions/mod.rs
1
100.0
src/completions/zsh.rs
1
100.0
src/usage_parser.rs
Jobs
ID Job ID Ran Files Coverage
1 3326.1 22 May 2017 10:41PM UTC 0
92.12
Travis Job 3326.1
Source Files on build 3326
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3326
  • Pull Request #845
  • PR Base - master (#3317)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc