Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for slice strip_* functions #75078

Merged
merged 5 commits into from
Oct 30, 2020

Commits on Oct 12, 2020

  1. docs: Reword str::strip_prefix and strip_suffix a bit

    "Some is returned with <some value>" is an awkward construction.
    The use of the passive voice is a bit odd, and doesn't seem like the
    house style.
    
    So say instead "returns X, wrapped in `Some`", for which there is some
    other precedent in stdlib.
    
    Instead of repeating "with the prefix removed", say "after the
    prefix".  This is a bit clearer that the original is not modified.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    dbb0583 View commit details
    Browse the repository at this point in the history
  2. docs: Reword slice::strip_prefix and strip_suffix a bit

    The stabilisation issue, rust-lang#73413, has an open item for documentation.
    I looked at the docs and it is all there, but I felt it could do with
    some minor wording improvement.
    
    I looked at the `str::strip_prefix` docs for a template.  (That
    resulted in me slightly changing that doc too.)
    
    I de-linkified `None` and `Some`, as I felt that rather noisy..  I
    searched stdlib, and these don't seem to be usually linkified.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    b7974bd View commit details
    Browse the repository at this point in the history
  3. docs: Rewrap str::strip_prefix and strip_suffix back to 100

    Requested-by: @LukasKalbertodt
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    4549c77 View commit details
    Browse the repository at this point in the history
  4. docs: Rewrap slice::strip_prefix and strip_suffix back to 100

    Requested-by: @LukasKalbertodt
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    6f5e96f View commit details
    Browse the repository at this point in the history
  5. docs: slice::strip_prefix and strip_suffix, fold in sentence

    Roughly as requested by @LukasKalbertodt.  I still prefer clearly
    making these two cases.
    
    Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
    ijackson committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    22358c6 View commit details
    Browse the repository at this point in the history