Return reference in index_column.get()

This commit is contained in:
Yuriy Dupyn 2024-01-08 14:24:30 +01:00
parent f0d29eb399
commit b04f3d167b
3 changed files with 6 additions and 8 deletions

View file

@ -148,6 +148,7 @@ trait SqlResponseConsumer {
#[cfg(test)]
mod tests {
use super::*;
use std::collections::HashSet;
fn users_schema() -> TableSchema {
let id: ColumnPosition = 0;
@ -505,7 +506,7 @@ mod tests {
let plato_id = 0;
let aristotle_id = 1;
let plato_ids = index.get(&String("Plato".to_string()));
let plato_ids = index.get(&String("Plato".to_string())).cloned().unwrap_or(HashSet::new());
assert!(plato_ids.contains(&plato_id));
assert!(!plato_ids.contains(&aristotle_id));
assert!(plato_ids.len() == 1);