From ec5fad2d7f75c45aa6c1f26a230a45aa9af3a575 Mon Sep 17 00:00:00 2001 From: Robert Altner Date: Mon, 24 Apr 2023 10:44:18 +0200 Subject: [PATCH] remove unnecessary .to_owned() --- src/lexer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lexer.rs b/src/lexer.rs index 44f8c88..c97edd5 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -50,7 +50,7 @@ where } fn read_integer(&mut self, radix: u32) -> Option { - match u32::from_str_radix(self.scanner.by_ref().take_while(|c| c.is_digit(radix)).collect::().to_owned().as_str(), radix) { + match u32::from_str_radix(self.scanner.by_ref().take_while(|c| c.is_digit(radix)).collect::().as_str(), radix) { Ok(result) => Some(result), Err(e) => { eprintln!("Failed to read DecimalIntgegerLiteral: {e}");