Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Martin Dinov
POD
Commits
3f84ca4b
Commit
3f84ca4b
authored
1 year ago
by
Szymon
Browse files
Options
Download
Email Patches
Plain Diff
fix clippies from 1.73
parent
d48e1666
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libpod/src/v5/database_api/graph_schema.rs
+8
-4
libpod/src/v5/database_api/graph_schema.rs
libpod/src/v5/database_api/search.rs
+5
-3
libpod/src/v5/database_api/search.rs
libpod/src/v5/schema.rs
+3
-3
libpod/src/v5/schema.rs
with
16 additions
and
10 deletions
+16
-10
libpod/src/v5/database_api/graph_schema.rs
+
8
-
4
View file @
3f84ca4b
...
...
@@ -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
)|
{
...
...
This diff is collapsed.
Click to expand it.
libpod/src/v5/database_api/search.rs
+
5
-
3
View file @
3f84ca4b
...
...
@@ -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
(
", "
));
};
...
...
This diff is collapsed.
Click to expand it.
libpod/src/v5/schema.rs
+
3
-
3
View file @
3f84ca4b
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment