Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 60dabef
Choose a base ref
...
head repository: mina86/rust
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3c88708
Choose a head ref
  • 6 commits
  • 23 files changed
  • 1 contributor

Commits on Feb 16, 2023

  1. core: convert Pattern<'a> into Pattern<H: Haystack> (RFC 2295)

    As per RFC 2295, add a Haystack trait describing something that can be
    searched in and make core::str::Pattern (and related types) generic on
    that trait.  This will allow Pattern to be used for types other than
    str (most notably OsStr).
    
    The change mostly follows the RFC though there are some differences in
    Haystack trait.
    
    Most notably, instead of separate StartCursor and EndCursors types,
    there’s one Cursor type instead.  This eliminate the need for methods
    converting between the two types of cursors.
    
    Conversion from cursor to offset isn’t included either since as far as
    I can tell it’s not needed.  A generic code operating on Haystack
    doesn’t need a concept of offset.  It can operate on cursors instead.
    
    Lastly, rather than range_to_self as suggested in RFC this commit
    implements split_at_cursor_unchecked which simplifies default
    implementation of strip_prefix_of and strip_suffix_of.
    
    For now leave Pattern, Haystack et al in core::str::pattern.  Since
    they are no longer str-specific, I’ll move them to core::pattern in
    future commit.  This one leaves them in place to make the diff
    smaller.
    
    Issue: #49802
    mina86 committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    4391e6a View commit details
    Browse the repository at this point in the history
  2. core: move Pattern et al to core::pattern module (RFC 2295)

    Pattern is no longer str-specific, so move it from core::str::pattern
    module to a new core::pattern module.  This introduces no changes in
    behaviour or implementation.  Just moves stuff around and adjusts
    documentation.
    
    Issue: #49802
    mina86 committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    13fbed4 View commit details
    Browse the repository at this point in the history
  3. core: add core::pattern::loop_next helper function

    Negative delta FTW.
    
    Issue: #49802
    mina86 committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    0ff2270 View commit details
    Browse the repository at this point in the history
  4. core: implement Pattern<&[T]> for &[T]; get rid of SlicePattern

    Implement Haystack<&[T]> and corresponding Pattern<&[T]> for &[T].
    That is, provide implementation for searching for subslices in slices.
    This replaces SlicePattern type.
    
    To make use of this new implementations, provide a few new methods on
    [T] type modelling them after types on str.  Specifically, introduce
    {starts,ends}_with_pattern, find, rfind, [T]::{split,rsplit}_once and
    trim{,_start,_end}_matches.
    
    Note that due to existing starts_with and ends_with methods, the
    _pattern suffix had to be used.  This is unfortunate but the type
    of starts_with’s argument cannot be changed without affecting type
    inference and thus breaking the API.
    
    This change doesn’t implement functions returning iterators such as
    split_pattern or matches which in str type are built on top of the
    Pattern API.
    
    Issue: #49802
    Issue: #56345
    mina86 committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    7af0733 View commit details
    Browse the repository at this point in the history
  5. Predicate

    mina86 committed Feb 16, 2023
    Configuration menu
    Copy the full SHA
    587e335 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2023

  1. unix pattern

    mina86 committed Feb 18, 2023
    Configuration menu
    Copy the full SHA
    3c88708 View commit details
    Browse the repository at this point in the history
Loading