Skip to content

Commit

Permalink
use Cow
Browse files Browse the repository at this point in the history
  • Loading branch information
commonquail committed Oct 22, 2023
1 parent bc9d2e9 commit e350f81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::borrow::Cow;
use std::error::Error;
use std::fmt;
use std::io;
Expand Down Expand Up @@ -79,12 +80,12 @@ type CliResult<'a, T> = Result<T, CliError<'a>>;

#[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<io::Error> for CliError<'a> {
Expand Down

0 comments on commit e350f81

Please sign in to comment.