Skip to content

Commit 5e7c5e5

Browse files
committed
clippied the code
1 parent 9a298b2 commit 5e7c5e5

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub fn get_string_args(args: &[String]) -> (usize, ParsedArgs) {
5656
};
5757
(index, to_return)
5858
}
59-
59+
#[allow(clippy::cast_possible_wrap)]
6060
pub fn get_dash_args(args: &[String], start_index: usize, args_struct: &mut ParsedArgs) {
6161
args[start_index..].iter().for_each(|arg| {
6262
// for each arg after the start index

src/keywords.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl Default for Keyword {
8484
}
8585
}
8686

87+
#[allow(clippy::cast_possible_wrap)]
8788
fn toggle_case(string: &str, num: i32) -> String {
8889
println!("{}", string.len() + num as usize % 10);
8990
let num: usize = match string.len() as i32 - num {

src/parser/mod.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ impl Parser {
197197
{
198198
self.in_function = true; // for funtions inside functions see loop below for more info
199199
if let Some(t) = self.parse_from_token() {
200-
function.push(t)
200+
function.push(t);
201201
}
202202
}
203203
self.advance("parse_from_token after function body looking for function end");
@@ -282,8 +282,7 @@ impl Parser {
282282
error(
283283
self.tokens[1].line,
284284
format!(
285-
"identifier expected, after \"list\" found TokenType::{:?}",
286-
tokentype
285+
"identifier expected, after \"list\" found TokenType::{tokentype:?}"
287286
)
288287
.as_str(),
289288
);
@@ -321,8 +320,7 @@ impl Parser {
321320
error(
322321
self.token.line,
323322
format!(
324-
"identifier expected after \"create\", found TokenType::{:?}",
325-
tokentype
323+
"identifier expected after \"create\", found TokenType::{tokentype:?}"
326324
)
327325
.as_str(),
328326
);
@@ -384,8 +382,7 @@ impl Parser {
384382
error(
385383
self.token.line,
386384
format!(
387-
"boolean expected, in if statement condition found TokenType::{:?}",
388-
tokentype
385+
"boolean expected, in if statement condition found TokenType::{tokentype:?}"
389386
)
390387
.as_str(),
391388
);
@@ -619,8 +616,7 @@ impl Parser {
619616
error(
620617
self.token.line,
621618
format!(
622-
"identifier expected, after \"create\" found TokenType::{:?}",
623-
tokentype
619+
"identifier expected, after \"create\" found TokenType::{tokentype:?}"
624620
)
625621
.as_str(),
626622
);

src/token.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ impl TokenType {
290290
error::error(
291291
line,
292292
format!(
293-
"{} and {} are not the same type which is required for {} operator",
294-
type_, type_1, self
293+
"{type_} and {type_1} are not the same type which is required for {self} operator"
295294
),
296295
);
297296
}
@@ -415,7 +414,7 @@ impl TokenType {
415414
}
416415
}
417416
} else {
418-
error::error(line, format!("Unknown keyword, {}", self));
417+
error::error(line, format!("Unknown keyword, {self}"));
419418
}
420419
}
421420
}

0 commit comments

Comments
 (0)