Skip to main content

FastLowercase

Trait FastLowercase 

Source
pub trait FastLowercase {
    // Required method
    fn to_lowercase_fast(&self) -> Cow<'_, str>;
}
Expand description

Trait providing fast lowercase conversion

Required Methods§

Source

fn to_lowercase_fast(&self) -> Cow<'_, str>

Convert to lowercase fast

Only converts strings that contain at least one uppercase character, otherwise it doesn’t touch it and just returns a borrowed string

§Returns

A lowercase string as Cow

§Examples
use std::borrow::Cow;
use superwhich::FastLowercase;

let a = "abc";
let b = "aBc";

let a_l = a.to_lowercase_fast(); // Borrowed("abc")
let b_l = b.to_lowercase_fast(); // Owned("abc")

Implementors§

Source§

impl<T> FastLowercase for T
where T: AsRef<str>,