Skip to content

Commit

Permalink
Clippy update fixes & version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
tuqqu committed May 11, 2021
1 parent aab6142 commit ac291da
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oxide"
version = "0.6.0"
version = "0.7.0"
authors = ["tuqqu <[email protected]>"]
edition = "2018"

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ let e = Math::get_e(); // ok
- `&`, `|`, `^` bitwise operations on integers
- `+` string concatenation
- `as` type cast operator, used to convert primitives to some type: `30 as bool`
- `..`, `..=` range operators, create a `vec<int>` value
- `=`, `+=`, `-=`, `/=`, `%=`, `*=`, `&=`, `|=`, `^=` various corresponding assignment operators

## Comments
Expand Down
5 changes: 1 addition & 4 deletions src/interpreter/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,10 +475,7 @@ impl Env {
if self.impls.contains_key(&name.lexeme) {
let impl_ = self.impls.get(&name.lexeme);

return match impl_ {
Some(impl_) => Some(impl_.clone()),
None => None,
};
return impl_.cloned();
}

if self.enclosing.is_some() {
Expand Down
2 changes: 1 addition & 1 deletion src/interpreter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl Interpreter {

match self.mode.clone() {
Mode::EntryPoint(f) => {
let f = if let Some(f) = f { Some(*f) } else { None };
let f = f.map(|f| *f);
match f {
Some(env::Function {
val: main @ Val::Callable(_),
Expand Down
4 changes: 2 additions & 2 deletions src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,9 @@ impl CallStruct {
impl Vec_ {
pub fn new(vals: Vec<Expr>, val_type: Option<ValType>, token: Token) -> Self {
Self {
token,
vals,
val_type,
token,
}
}
}
Expand Down Expand Up @@ -427,8 +427,8 @@ impl VarDecl {
Self {
name,
init,
mutable,
v_type,
mutable,
}
}
}
Expand Down

0 comments on commit ac291da

Please sign in to comment.