MCPcopy Create free account
hub / github.com/belchior/sql_query_builder / push_unique

Function push_unique

src/utils.rs:3–8  ·  view source on GitHub ↗
(list: &mut Vec<T>, value: T)

Source from the content-addressed store, hash-verified

1use std::cmp::PartialEq;
2
3pub(crate) fn push_unique<T: PartialEq>(list: &mut Vec<T>, value: T) {
4 let prev_item = list.iter().find(|&item| *item == value);
5 if prev_item.is_none() {
6 list.push(value);
7 }
8}
9
10pub(crate) fn join(list: &Vec<String>, sep: &str) -> String {
11 list

Callers 15

drop_indexMethod · 0.85
rawMethod · 0.85
drop_index_if_existsMethod · 0.85
addMethod · 0.85
dropMethod · 0.85
rawMethod · 0.85
renameMethod · 0.85
alterMethod · 0.85
rawMethod · 0.85
where_clauseMethod · 0.85
where_orMethod · 0.85
returningMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected