@@ -114,7 +114,7 @@ impl TriggerIndex {
114114 for token in & unique {
115115 * doc_freq. entry ( token. to_string ( ) ) . or_insert ( 0 ) += 1 ;
116116 }
117- self . triggers . insert ( node_id. clone ( ) , tokens) ;
117+ self . triggers . insert ( * node_id, tokens) ;
118118 }
119119
120120 // Compute IDF: log((N + 1) / (df + 1)) + 1 (smoothed)
@@ -175,7 +175,7 @@ impl TriggerIndex {
175175 let similarity = dot / ( query_norm * doc_norm) ;
176176
177177 if similarity >= self . threshold {
178- results. push ( ( node_id. clone ( ) , similarity) ) ;
178+ results. push ( ( * node_id, similarity) ) ;
179179 }
180180 }
181181
@@ -242,7 +242,7 @@ impl TriggerIndex {
242242 pub fn get_trigger_descriptions ( & self ) -> AHashMap < u64 , String > {
243243 self . triggers
244244 . iter ( )
245- . map ( |( node_id, tokens) | ( node_id. clone ( ) , tokens. join ( " " ) ) )
245+ . map ( |( node_id, tokens) | ( * node_id, tokens. join ( " " ) ) )
246246 . collect ( )
247247 }
248248}
@@ -434,7 +434,7 @@ impl RoleGraph {
434434 log:: trace!( "Finding matching node IDs for text: '{text}'" ) ;
435435 self . ac
436436 . find_iter ( text)
437- . map ( |mat| self . aho_corasick_values [ mat. pattern ( ) ] . clone ( ) )
437+ . map ( |mat| self . aho_corasick_values [ mat. pattern ( ) ] )
438438 . collect ( )
439439 }
440440
@@ -669,7 +669,7 @@ impl RoleGraph {
669669 matched_edges : vec ! [ edge. clone( ) ] ,
670670 rank : total_rank,
671671 tags : vec ! [ normalized_term. to_string( ) ] ,
672- nodes : vec ! [ node_id. clone ( ) ] ,
672+ nodes : vec ! [ node_id] ,
673673 quality_score : None ,
674674 } ) ;
675675 }
@@ -678,7 +678,7 @@ impl RoleGraph {
678678 doc. rank += total_rank; // Adjust to correctly aggregate the rank
679679 doc. matched_edges . push ( edge. clone ( ) ) ;
680680 // Remove duplicate edges based on unique IDs
681- doc. matched_edges . dedup_by_key ( |e| e. id . clone ( ) ) ;
681+ doc. matched_edges . dedup_by_key ( |e| e. id ) ;
682682 }
683683 }
684684 }
@@ -769,7 +769,7 @@ impl RoleGraph {
769769 matched_edges : vec ! [ edge. clone( ) ] ,
770770 rank : total_rank,
771771 tags : vec ! [ normalized_term. to_string( ) ] ,
772- nodes : vec ! [ node_id. clone ( ) ] ,
772+ nodes : vec ! [ node_id] ,
773773 quality_score : None ,
774774 } ) ;
775775 }
@@ -778,7 +778,7 @@ impl RoleGraph {
778778 doc. rank += total_rank; // Adjust to correctly aggregate the rank
779779 doc. matched_edges . push ( edge. clone ( ) ) ;
780780 // Remove duplicate edges based on unique IDs
781- doc. matched_edges . dedup_by_key ( |e| e. id . clone ( ) ) ;
781+ doc. matched_edges . dedup_by_key ( |e| e. id ) ;
782782 }
783783 }
784784 }
@@ -873,21 +873,21 @@ impl RoleGraph {
873873 matched_edges : vec ! [ edge. clone( ) ] ,
874874 rank : total_rank,
875875 tags : vec ! [ normalized_term. to_string( ) ] ,
876- nodes : vec ! [ node_id. clone ( ) ] ,
876+ nodes : vec ! [ node_id] ,
877877 quality_score : None ,
878878 } ) ;
879879 }
880880 Entry :: Occupied ( mut e) => {
881881 let doc = e. get_mut ( ) ;
882882 doc. rank += total_rank;
883883 doc. matched_edges . push ( edge. clone ( ) ) ;
884- doc. matched_edges . dedup_by_key ( |e| e. id . clone ( ) ) ;
884+ doc. matched_edges . dedup_by_key ( |e| e. id ) ;
885885 // Add the tag if not already present
886886 if !doc. tags . contains ( & normalized_term. to_string ( ) ) {
887887 doc. tags . push ( normalized_term. to_string ( ) ) ;
888888 }
889889 if !doc. nodes . contains ( & node_id) {
890- doc. nodes . push ( node_id. clone ( ) ) ;
890+ doc. nodes . push ( node_id) ;
891891 }
892892 }
893893 }
@@ -977,7 +977,7 @@ impl RoleGraph {
977977 matched_edges : vec ! [ edge. clone( ) ] ,
978978 rank : total_rank,
979979 tags : vec ! [ normalized_term. to_string( ) ] ,
980- nodes : vec ! [ node_id. clone ( ) ] ,
980+ nodes : vec ! [ node_id] ,
981981 quality_score : None ,
982982 } ,
983983 vec ! [ term. to_string( ) ] ,
@@ -987,12 +987,12 @@ impl RoleGraph {
987987 let ( doc, terms) = e. get_mut ( ) ;
988988 doc. rank += total_rank;
989989 doc. matched_edges . push ( edge. clone ( ) ) ;
990- doc. matched_edges . dedup_by_key ( |e| e. id . clone ( ) ) ;
990+ doc. matched_edges . dedup_by_key ( |e| e. id ) ;
991991 if !doc. tags . contains ( & normalized_term. to_string ( ) ) {
992992 doc. tags . push ( normalized_term. to_string ( ) ) ;
993993 }
994994 if !doc. nodes . contains ( & node_id) {
995- doc. nodes . push ( node_id. clone ( ) ) ;
995+ doc. nodes . push ( node_id) ;
996996 }
997997 if !terms. contains ( & term. to_string ( ) ) {
998998 terms. push ( term. to_string ( ) ) ;
@@ -1026,7 +1026,7 @@ impl RoleGraph {
10261026 combined_doc
10271027 . matched_edges
10281028 . extend ( term_doc. matched_edges . clone ( ) ) ;
1029- combined_doc. matched_edges . dedup_by_key ( |e| e. id . clone ( ) ) ;
1029+ combined_doc. matched_edges . dedup_by_key ( |e| e. id ) ;
10301030
10311031 for tag in & term_doc. tags {
10321032 if !combined_doc. tags . contains ( tag) {
@@ -1036,7 +1036,7 @@ impl RoleGraph {
10361036
10371037 for node in & term_doc. nodes {
10381038 if !combined_doc. nodes . contains ( node) {
1039- combined_doc. nodes . push ( node. clone ( ) ) ;
1039+ combined_doc. nodes . push ( * node) ;
10401040 }
10411041 }
10421042
0 commit comments