Skip to content

Commit

Permalink
Merge branch 'use-cow' into 'master'
Browse files Browse the repository at this point in the history
use Cow

See merge request mkjeldsen/commitmsgfmt!68
  • Loading branch information
commonquail committed Oct 22, 2023
2 parents bc9d2e9 + e350f81 commit 7c95849
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 7c95849

Please sign in to comment.