From 9d854fc5baad01d059acdb96fad82700042ef114 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Fri, 11 Jan 2019 01:30:24 +0000 Subject: Implement From<&str> for Error This patch implements From<&str> for Error so that we can use Error::from(s) as a shorthand for Error::Error(s.to_string()). It also replaces Error::Error with Error::from where possible. --- nitrocli/src/args.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nitrocli/src/args.rs') diff --git a/nitrocli/src/args.rs b/nitrocli/src/args.rs index 246490e..f4e0758 100644 --- a/nitrocli/src/args.rs +++ b/nitrocli/src/args.rs @@ -539,8 +539,8 @@ pub fn otp_set(ctx: &mut ExecCtx<'_>, args: Vec) -> Result<()> { if ascii { if secret_format.is_some() { - return Err(Error::Error( - "The --format and the --ascii option cannot be used at the same time".to_string(), + return Err(Error::from( + "The --format and the --ascii option cannot be used at the same time", )); } -- cgit v1.2.1