From e350f814e4abd67dfe0d247af5b28d074a0bde99 Mon Sep 17 00:00:00 2001 From: Mikkel Kjeldsen Date: Sat, 21 Oct 2023 16:17:39 +0200 Subject: [PATCH] use Cow --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3dc76cc..45bfc31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::error::Error; use std::fmt; use std::io; @@ -79,12 +80,12 @@ type CliResult<'a, T> = Result>; #[derive(Debug)] enum CliError<'a> { - ArgUnrecognized(std::borrow::Cow<'a, str>), + ArgUnrecognized(Cow<'a, str>), ArgWidthNaN(ParseIntError), ArgWidthOutOfBounds(i32), - EarlyExit(std::borrow::Cow<'a, str>), + EarlyExit(Cow<'a, str>), Io(io::Error), - Other(std::borrow::Cow<'a, str>), + Other(Cow<'a, str>), } impl<'a> From for CliError<'a> {