Skip to content

Commit

Permalink
Return slice of TokenSearchResult rather than clone by default
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed May 25, 2020
1 parent f92b4ab commit d3dd186
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/token_analysis/src/token_usage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl TokenUsageResults {
results: TokenSearchResults,
config: &ProjectConfiguration,
) -> Self {
let unwrapped_results = results.value();
let unwrapped_results = results.value().to_vec();
let size = &unwrapped_results.len();

let results = unwrapped_results
Expand Down
4 changes: 2 additions & 2 deletions crates/token_search/src/token_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ impl TokenSearchResults {
}

/// Extract search results
pub fn value(&self) -> Vec<TokenSearchResult> {
self.0.clone()
pub fn value(&self) -> &[TokenSearchResult] {
&self.0
}

/// Generate results based on provided search config
Expand Down

0 comments on commit d3dd186

Please sign in to comment.