Open
Description
Right now:
pub fn eq_ignore_ascii_case(&self, other: &char) -> bool {
self.to_ascii_lowercase() == other.to_ascii_lowercase()
}
This means that 'a'.eq_ignore_ascii_case('b')
doesn't compile. Instead the user must type 'a'.eq_ignore_ascii_case(&'b')
. I would like to allow for both without breaking backwards compatibility.
One option would be to change the signature to the following:
pub fn eq_ignore_ascii_case<C: AsRef<char>>(&self, other: C) -> bool {
self.to_ascii_lowercase() == other.as_ref().to_ascii_lowercase()
}
This would require us to implement AsRef<char>
for char
and &char
to facilitate this.