aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2019-01-08 04:13:23 +0000
committerRobin Krahl <robin.krahl@ireas.org>2019-01-08 05:13:45 +0100
commit4ffee6bacc3579c57687f4029d2fc73213592c39 (patch)
tree1daf3804dd42d70013a39e6ba62548547726fb38 /examples
parentfce7d2b9bf30e09b615dbd77b4dd7db94d623bfb (diff)
downloaddialog-rs-4ffee6bacc3579c57687f4029d2fc73213592c39.tar.gz
dialog-rs-4ffee6bacc3579c57687f4029d2fc73213592c39.tar.bz2
Refactor io::Error into custom Error enum
Diffstat (limited to 'examples')
-rw-r--r--examples/backend-dialog.rs4
-rw-r--r--examples/input.rs4
-rw-r--r--examples/message.rs4
-rw-r--r--examples/question.rs4
4 files changed, 4 insertions, 12 deletions
diff --git a/examples/backend-dialog.rs b/examples/backend-dialog.rs
index b6be492..e1491f4 100644
--- a/examples/backend-dialog.rs
+++ b/examples/backend-dialog.rs
@@ -1,12 +1,10 @@
// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org>
// SPDX-License-Identifier: MIT
-use std::io::Result;
-
use dialog::backends;
use dialog::DialogBox;
-fn main() -> Result<()> {
+fn main() -> dialog::Result<()> {
let mut backend = backends::Dialog::new();
dialog::Message::new("This is a message.")
diff --git a/examples/input.rs b/examples/input.rs
index bb36fb6..d852a5e 100644
--- a/examples/input.rs
+++ b/examples/input.rs
@@ -1,11 +1,9 @@
// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org>
// SPDX-License-Identifier: MIT
-use std::io::Result;
-
use dialog::DialogBox;
-fn main() -> Result<()> {
+fn main() -> dialog::Result<()> {
let input1 = dialog::Input::new("Please enter something").show()?;
let input2 = dialog::Input::new("Please enter something")
.title("Input form")
diff --git a/examples/message.rs b/examples/message.rs
index a72ef00..6d1ea4d 100644
--- a/examples/message.rs
+++ b/examples/message.rs
@@ -1,11 +1,9 @@
// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org>
// SPDX-License-Identifier: MIT
-use std::io::Result;
-
use dialog::DialogBox;
-fn main() -> Result<()> {
+fn main() -> dialog::Result<()> {
dialog::Message::new("This is a message.").show()?;
dialog::Message::new("This is a message.")
diff --git a/examples/question.rs b/examples/question.rs
index d9c0e91..f5a692a 100644
--- a/examples/question.rs
+++ b/examples/question.rs
@@ -1,11 +1,9 @@
// Copyright (C) 2019 Robin Krahl <robin.krahl@ireas.org>
// SPDX-License-Identifier: MIT
-use std::io::Result;
-
use dialog::DialogBox;
-fn main() -> Result<()> {
+fn main() -> dialog::Result<()> {
let choice = dialog::Question::new("Do you want to continue?").show()?;
println!("The user chose: {:?}", choice);
Ok(())