Skip to content

Commit

Permalink
release: 0.1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
joshstoik1 committed Jun 2, 2023
2 parents d8b5ce7 + 1d3ac13 commit 6c3f16c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Changelog


## [0.1.8](https://github.com/Blobfolio/trimothy/releases/tag/v0.1.8) - 2023-06-01

## [0.1.7](https://github.com/Blobfolio/trimothy/releases/tag/v0.1.7) - 2023-06-01
### Changed

* Fix UTF8 issue with String::trim_end*



## ~~0.1.7~~ - 2023-06-01

### Changed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trimothy"
version = "0.1.7"
version = "0.1.8"
authors = ["Blobfolio, LLC. <[email protected]>"]
edition = "2021"
rust-version = "1.56"
Expand Down
10 changes: 4 additions & 6 deletions src/trim_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,14 @@ impl TrimMatchesMut for String {
/// ```
/// use trimothy::TrimMatchesMut;
///
/// let mut s = String::from(" Hello World! ");
/// let mut s = String::from(" Hello WorlÐ! ");
/// s.trim_end_matches_mut(|c: char| ' ' == c || '!' == c);
/// assert_eq!(s, " Hello World");
/// assert_eq!(s, " Hello WorlÐ");
/// ```
fn trim_end_matches_mut<F>(&mut self, cb: F)
where F: Fn(Self::MatchUnit) -> bool {
if let Some(end) = self.rfind(|c| ! cb(c)) {
self.truncate(end + 1);
}
else { self.truncate(0); }
let alt = self.trim_end_matches(|c| cb(c));
self.truncate(alt.len());
}
}

Expand Down

0 comments on commit 6c3f16c

Please sign in to comment.