From 4ffee6bacc3579c57687f4029d2fc73213592c39 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Tue, 8 Jan 2019 04:13:23 +0000 Subject: Refactor io::Error into custom Error enum --- examples/backend-dialog.rs | 4 +--- examples/input.rs | 4 +--- examples/message.rs | 4 +--- examples/question.rs | 4 +--- 4 files changed, 4 insertions(+), 12 deletions(-) (limited to 'examples') 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 // 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 // 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 // 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 // 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(()) -- cgit v1.2.1