Skip to content

Commit

Permalink
api: impl Clone for Utf8Error
Browse files Browse the repository at this point in the history
This matches what std::str::Utf8Error has, and it seems like a common
sense impl.

We do not add a 'Copy' impl however, since that seems like a backcompat
hazard. Although, it does seem unlikely that this error type will ever
*not* be 'Copy', it's not clear to me that 'Copy' makes semantic sense
for this type.

Closes #113
  • Loading branch information
TethysSvensson authored and BurntSushi committed Jul 11, 2022
1 parent 1c52ad7 commit 492952f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ impl<'a> ::core::iter::FusedIterator for Utf8Chunks<'a> {}
/// assert_eq!(err.valid_up_to(), 6);
/// assert_eq!(err.error_len(), Some(1));
/// ```
#[derive(Debug, Eq, PartialEq)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Utf8Error {
valid_up_to: usize,
error_len: Option<usize>,
Expand Down

0 comments on commit 492952f

Please sign in to comment.