Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused import #28

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/ed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ pub struct EdPatch {
impl crate::ContentPatch for EdPatch {
fn apply_exact(&self, orig: &[u8]) -> Result<Vec<u8>, crate::ApplyError> {
let lines = splitlines(orig).collect::<Vec<_>>();
let result = self
.apply(&lines)
.map_err(|e| crate::ApplyError::Conflict(e))?;
let result = self.apply(&lines).map_err(crate::ApplyError::Conflict)?;
Ok(result)
}
}
Expand All @@ -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!(
Expand Down
1 change: 0 additions & 1 deletion src/unified.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down