File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -414,7 +414,7 @@ fn matched_item<I: Sync + Send + Clone + 'static>(
414414
415415 MatchedItem :: new (
416416 store. items [ index as usize ] . clone ( ) ,
417- haystack. clone ( ) ,
417+ haystack. to_string ( ) ,
418418 // Convert UTF-8 byte offsets to UTF-32 character indices
419419 byte_indices_to_char_indices ( haystack, match_indices) ,
420420 )
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ pub(super) struct Store<I> {
3232 /// Items that have been added to the matcher.
3333 pub ( super ) items : Vec < I > ,
3434 /// The strings the items are matched against.
35- pub ( super ) haystacks : Vec < String > ,
35+ pub ( super ) haystacks : Vec < Box < str > > ,
3636}
3737
3838impl < I > Default for Store < I > {
@@ -308,7 +308,7 @@ where
308308 store. haystacks . reserve ( batch. len ( ) ) ;
309309 for ( item, haystack) in batch {
310310 store. items . push ( item) ;
311- store. haystacks . push ( haystack) ;
311+ store. haystacks . push ( haystack. into_boxed_str ( ) ) ;
312312 }
313313 true
314314 }
You can’t perform that action at this time.
0 commit comments