From 3ae414166691845408171ad924c657c0494306e7 Mon Sep 17 00:00:00 2001 From: Project Nayuki Date: Thu, 4 Nov 2021 15:18:34 +0000 Subject: [PATCH] Slightly deoptimized Rust code for clarity, partly undoing commit 6c1f96789429. --- rust/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 2afae46..cb87c37 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -1124,7 +1124,7 @@ impl QrSegment { /// /// A string is encodable iff each character is in the range 0 to 9. pub fn is_numeric(text: &str) -> bool { - text.bytes().all(|b| (b'0' ..= b'9').contains(&b)) + text.chars().all(|c| ('0' ..= '9').contains(&c)) }