summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-04-04 11:17:21 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-04-04 11:17:38 +0200
commit5b475e392217210d0ca4bf09ba0f131300cdccfd (patch)
tree70db850098138cb2d8ddbf2a4146a96a5968fdd9
parent7d7d52161a576549edc4e4a6d59908b8838137e8 (diff)
Edition 2018
-rw-r--r--Cargo.lock14
-rw-r--r--Cargo.toml1
-rw-r--r--src/main.rs4
3 files changed, 11 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 0c293ce..0acc6ce 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,4 +1,11 @@
-[root]
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "libc"
+version = "0.2.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+
+[[package]]
name = "rcalc"
version = "0.1.0"
dependencies = [
@@ -6,11 +13,6 @@ dependencies = [
]
[[package]]
-name = "libc"
-version = "0.2.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
name = "termion"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/Cargo.toml b/Cargo.toml
index a7c86ea..24e665a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,7 @@
name = "rcalc"
version = "0.1.0"
authors = ["tomsmeding <tom.smeding@gmail.com>"]
+edition = "2018"
[dependencies]
termion = "1"
diff --git a/src/main.rs b/src/main.rs
index adaa058..3d06aec 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-extern crate termion;
+use termion;
use termion::event::Key;
use termion::input::TermRead;
@@ -64,7 +64,7 @@ struct State<'a> {
command_map: &'a HashMap<String, (usize, Callback)>,
}
-fn handle_key(key: Key, st: &mut State) -> Option<bool> {
+fn handle_key(key: Key, st: &mut State<'_>) -> Option<bool> {
match key {
// Quitting
Key::Ctrl('c') | Key::Ctrl('d') => {