Skip to content

Commit

Permalink
Limit cloning to the small Vec
Browse files Browse the repository at this point in the history
  • Loading branch information
havenwood committed Nov 20, 2024
1 parent fed7d4a commit aaa4fde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ impl WordTally {
}

/// Gets the `filters` field.
pub fn filters(&self) -> Filters {
self.filters.clone()
pub const fn filters(&self) -> &Filters {
&self.filters
}

/// Gets the `uniq_count` field.
Expand Down
2 changes: 1 addition & 1 deletion src/verbose.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl Verbose {
stderr,
"exclude-words",
delimiter,
self.format(filters.exclude),
self.format(filters.exclude.clone()),
)?;

if word_tally.count() > 0 {
Expand Down

0 comments on commit aaa4fde

Please sign in to comment.