stable_string_patterns_method 0.0.1

Stable polyfill to be able to depends on a trait that mimics `str::pattern::Pattern` on stable Rust.
Documentation
  • Coverage
  • 2.9%
    2 out of 69 items documented1 out of 57 items with examples
  • Size
  • Source code size: 42.73 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 4.55 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m Average build duration of successful builds.
  • all releases: 1m Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • krtab/stable_string_patterns_method
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • krtab

Stable polyfill to be able to depends on a trait that mimics str::pattern::Pattern on stable Rust.

fn starts_and_ends_with(haystack: &str, p: impl IntoSearchable + Clone) -> bool {
    haystack.starts_with_(p.clone()) && haystack.ends_with_(p)
}

assert!(starts_and_ends_with("aa bb aa", "aa"));
assert!(starts_and_ends_with("aa bb aa", 'a'));
assert!(starts_and_ends_with("aa bb cc", ['a','c']));
assert!(starts_and_ends_with("\t bb  \n", WhiteSpace));