From 29d5f04f5e5b54aae599969ed15d2d255bc79bf7 Mon Sep 17 00:00:00 2001 From: Thibault Date: Thu, 23 May 2024 19:01:44 +0200 Subject: [PATCH] refactor: clippy --- src/abstract_syntax_tree.rs | 4 ++-- src/runtime.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/abstract_syntax_tree.rs b/src/abstract_syntax_tree.rs index 70b4239..0b7164f 100644 --- a/src/abstract_syntax_tree.rs +++ b/src/abstract_syntax_tree.rs @@ -78,13 +78,13 @@ impl Ast { impl AstNode { pub fn new(value: char, parent_index: usize, is_leaf: bool, index_in_string: usize) -> Self { - return AstNode { + AstNode { char: value, sub_assets_indexes: Vec::new(), parent_index: Some(parent_index), is_leaf, index_in_string, - }; + } } } diff --git a/src/runtime.rs b/src/runtime.rs index 1ba785e..ec27824 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -108,7 +108,7 @@ impl<'a> Runtime<'a> { if result.is_err() { return Err(result.err().unwrap().to_string()); } - buffer = buffer.replace("\r", ""); + buffer = buffer.replace('\r', ""); let mut vec = buffer.as_bytes().to_vec(); vec.push(0); self.read_buffer = vec;