Skip to content

Commit c458de7

Browse files
committed
Fix clippy warnings
1 parent a48184e commit c458de7

4 files changed

Lines changed: 2 additions & 6 deletions

File tree

.cargo/config.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ rustflags = [
3939
"-Wclippy::map_err_ignore",
4040
"-Wclippy::map_flatten",
4141
"-Wclippy::map_unwrap_or",
42-
"-Wclippy::match_on_vec_items",
4342
"-Wclippy::match_same_arms",
4443
"-Wclippy::match_wild_err_arm",
4544
"-Wclippy::match_wildcard_for_single_variants",
@@ -62,7 +61,6 @@ rustflags = [
6261
"-Wclippy::string_add_assign",
6362
"-Wclippy::string_add",
6463
"-Wclippy::string_lit_as_bytes",
65-
"-Wclippy::string_to_string",
6664
"-Wclippy::todo",
6765
"-Wclippy::trait_duplication_in_bounds",
6866
"-Wclippy::unimplemented",

ndc_lib/src/interpreter/environment.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Environment {
139139
);
140140
}
141141
ResolvedVar::Global { .. } => {
142-
todo!("convert to panic?? you cannot assign to the global scope right?")
142+
unreachable!("cannot assign value to global")
143143
}
144144
}
145145
}

ndc_lib/src/interpreter/evaluate/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,8 @@ pub(crate) fn evaluate_expression(
292292
let result = evaluate_expression(loop_body, environment);
293293
match result {
294294
Err(FunctionCarrier::Break(value)) => return Ok(value),
295-
Err(FunctionCarrier::Continue) => {}
295+
Err(FunctionCarrier::Continue) | Ok(_) => {}
296296
Err(err) => return Err(err),
297-
Ok(_) => {}
298297
}
299298
} else if lit == Value::Bool(false) {
300299
break;

ndc_lib/src/lexer/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ impl Iterator for Lexer<'_> {
118118
match (first, second) {
119119
(' ' | '\t' | '\r' | '\n', _) => {
120120
self.source.consume(1);
121-
continue;
122121
}
123122
('r', Some('"' | '#')) => {
124123
return Some(self.lex_string_literal());

0 commit comments

Comments
 (0)