diff --git a/Cargo.lock b/Cargo.lock index 91e9dce..638b0ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,7 +169,7 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "patchkit" -version = "0.2.0" +version = "0.2.1" dependencies = [ "chrono", "lazy-regex", diff --git a/src/ed.rs b/src/ed.rs index 7038471..477e875 100644 --- a/src/ed.rs +++ b/src/ed.rs @@ -10,9 +10,7 @@ pub struct EdPatch { impl crate::ContentPatch for EdPatch { fn apply_exact(&self, orig: &[u8]) -> Result, crate::ApplyError> { let lines = splitlines(orig).collect::>(); - let result = self - .apply(&lines) - .map_err(|e| crate::ApplyError::Conflict(e))?; + let result = self.apply(&lines).map_err(crate::ApplyError::Conflict)?; Ok(result) } } @@ -27,7 +25,7 @@ impl EdPatch { assert_eq!(start, end); let existing = match data.get(start - 1) { Some(existing) => existing, - None => return Err(format!("line {} does not exist", start).into()), + None => return Err(format!("line {} does not exist", start)), }; if existing != expected { return Err(format!( diff --git a/src/unified.rs b/src/unified.rs index a83ed36..b32e8a1 100644 --- a/src/unified.rs +++ b/src/unified.rs @@ -1,6 +1,5 @@ //! Parsing of unified patches use crate::{ContentPatch, SingleFilePatch}; -use regex::bytes::Regex; use std::num::ParseIntError; /// Errors that can occur while parsing a patch