char::is_ascii_ functions borrow but the other char::is_ functions consume?

66 points Hydrotronics 14 comments

Hii first time posting here so apologies if I'm using the wrong flair!

I'm just curious as to why the ascii functions borrow instead of copy. The code uses matches! macro but they immediately deref before putting it in anyway so why not have it consistent with the others? char is Copy which to my knowledge means there's little to no point borrowing it..

I came across this as I was using dyn Fn(char) -> bool and was confused when I couldn't put char::is_ascii_digit in directly