Commit 3f84ca4b authored by Szymon's avatar Szymon
Browse files

fix clippies from 1.73

parent d48e1666
Showing with 16 additions and 10 deletions
+16 -10
......@@ -22,6 +22,7 @@
// TODO: sqlite authors advice calling ANALYZE every several hours:
// https://www.sqlite.org/lang_analyze.html
use std::fmt::Write;
use std::{
collections::{HashMap, HashSet},
sync::Arc,
......@@ -354,10 +355,13 @@ async fn create_new_node_schema(
})
.collect();
let mut properties: String = BASE_PROPERTIES
.iter()
.map(|(prop_name, prop_type)| format!(" {prop_name} {prop_type},"))
.collect();
let mut properties =
BASE_PROPERTIES
.iter()
.fold(String::new(), |mut acc, (prop_name, prop_type)| {
let _ = write!(acc, " {prop_name} {prop_type},");
acc
});
properties.extend(
node_properties.iter().map(|(prop_name, prop_type)| {
......
......@@ -4,7 +4,7 @@
use std::{
cmp::{min, Ordering},
collections::{HashMap, HashSet},
fmt::Debug,
fmt::{Debug, Write},
};
use rusqlite::types::{ToSqlOutput, ValueRef};
......@@ -811,8 +811,10 @@ fn build_search_query_for_node<'a>(payload: &SearchNodeReq) -> Result<SearchNode
let fields = payload
.return_properties
.iter()
.map(|e| format!("{node_name}.{e}, "))
.collect::<String>();
.fold(String::new(), |mut acc, e| {
let _ = write!(acc, "{node_name}.{e}, ");
acc
});
selector.push_str(fields.trim_end_matches(", "));
};
......
......@@ -70,15 +70,15 @@ impl Schema {
let target_types = self
.nodes_connections
.entry(source_type.clone())
.or_insert_with(HashMap::new)
.or_default()
.entry(edge_name.clone())
.or_insert_with(Vec::new);
.or_default();
if !target_types.contains(&target_type) {
target_types.push(target_type.clone());
}
let edge = self.edges_types.entry(edge_name).or_insert_with(Vec::new);
let edge = self.edges_types.entry(edge_name).or_default();
if !edge
.iter()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment