@@ -133,10 +133,7 @@ fn graph_node_from_value(val: &Value) -> Option<GraphNode> {
133133 return None ;
134134 } ;
135135 let props = node. get_properties ( ) ;
136- let owned: Vec < ( String , Value ) > = props
137- . iter ( )
138- . map ( |( k, v) | ( k. clone ( ) , v. clone ( ) ) )
139- . collect ( ) ;
136+ let owned: Vec < ( String , Value ) > = props. iter ( ) . map ( |( k, v) | ( k. clone ( ) , v. clone ( ) ) ) . collect ( ) ;
140137 let id = format ! (
141138 "{}:{}" ,
142139 node. get_node_id( ) . table_id,
@@ -248,7 +245,11 @@ fn collect_edges_arrow(
248245 node_ids. insert ( ( st, so) ) ;
249246 node_ids. insert ( ( dt, doff) ) ;
250247 if seen. insert ( ( source. clone ( ) , target. clone ( ) , label. clone ( ) ) ) {
251- links. push ( GraphLink { source, target, label } ) ;
248+ links. push ( GraphLink {
249+ source,
250+ target,
251+ label,
252+ } ) ;
252253 }
253254 }
254255 }
@@ -283,17 +284,15 @@ fn collect_edges_csr(
283284 . context ( "arrow csr query failed" ) ?;
284285 let csr = result. csr ( ) . context ( "no CSR metadata" ) ?;
285286 let mut meta = conn
286- . query ( & format ! ( "MATCH (a)-[r:{rel}]->(b) RETURN id(a), id(b) LIMIT 1" ) )
287+ . query ( & format ! (
288+ "MATCH (a)-[r:{rel}]->(b) RETURN id(a), id(b) LIMIT 1"
289+ ) )
287290 . context ( "rel endpoint query failed" ) ?;
288291 let ( src_table, dst_table) = match meta. next ( ) {
289- Some ( row) if row. len ( ) >= 2 => {
290- match ( & row[ 0 ] , & row[ 1 ] ) {
291- ( Value :: InternalID ( s) , Value :: InternalID ( d) ) => {
292- ( s. table_id , d. table_id )
293- }
294- _ => continue ,
295- }
296- }
292+ Some ( row) if row. len ( ) >= 2 => match ( & row[ 0 ] , & row[ 1 ] ) {
293+ ( Value :: InternalID ( s) , Value :: InternalID ( d) ) => ( s. table_id , d. table_id ) ,
294+ _ => continue ,
295+ } ,
297296 _ => continue , // empty rel table
298297 } ;
299298 let indptr = csr. indptr . values ( ) ;
@@ -354,7 +353,9 @@ pub fn collect_edge_graph(conn: &Connection, limit: usize) -> Result<GraphData>
354353 node_ids = ids;
355354 }
356355 Err ( e) => {
357- eprintln ! ( "bugscope: CSR edge scan unavailable ({e}); falling back to columnar Arrow scan" ) ;
356+ eprintln ! (
357+ "bugscope: CSR edge scan unavailable ({e}); falling back to columnar Arrow scan"
358+ ) ;
358359 collect_edges_arrow ( conn, limit, & mut links, & mut node_ids) ?
359360 }
360361 }
@@ -414,10 +415,14 @@ fn enrich_node_properties(
414415 offsets. sort_unstable ( ) ;
415416 offsets. dedup ( ) ;
416417 for chunk in offsets. chunks ( 1000 ) {
417- let list = chunk. iter ( ) . map ( |o| o. to_string ( ) ) . collect :: < Vec < _ > > ( ) . join ( "," ) ;
418- let Ok ( mut result) =
419- conn. query ( & format ! ( "MATCH (n:{label}) WHERE offset(id(n)) IN [{list}] RETURN n" ) )
420- else {
418+ let list = chunk
419+ . iter ( )
420+ . map ( |o| o. to_string ( ) )
421+ . collect :: < Vec < _ > > ( )
422+ . join ( "," ) ;
423+ let Ok ( mut result) = conn. query ( & format ! (
424+ "MATCH (n:{label}) WHERE offset(id(n)) IN [{list}] RETURN n"
425+ ) ) else {
421426 continue ;
422427 } ;
423428 for row in & mut result {
@@ -468,7 +473,10 @@ pub fn collect_schema_graph(conn: &Connection) -> Result<GraphData> {
468473 properties : HashMap :: new ( ) ,
469474 } )
470475 . collect ( ) ;
471- Ok ( GraphData { nodes, links : vec ! [ ] } )
476+ Ok ( GraphData {
477+ nodes,
478+ links : vec ! [ ] ,
479+ } )
472480}
473481
474482/// Substring search over node properties — port of `search_nodes` fallback path.
@@ -531,8 +539,7 @@ pub fn neighborhood(full: &GraphData, focus: &str) -> GraphData {
531539 neighbor_ids. sort_by_key ( |id| std:: cmp:: Reverse ( * degrees. get ( id) . unwrap_or ( & 0 ) ) ) ;
532540 let mut visible: HashSet < & str > = neighbor_ids. into_iter ( ) . take ( NEIGHBOR_LIMIT ) . collect ( ) ;
533541 visible. insert ( focus) ;
534- let by_id: HashMap < & str , & GraphNode > =
535- full. nodes . iter ( ) . map ( |n| ( n. id . as_str ( ) , n) ) . collect ( ) ;
542+ let by_id: HashMap < & str , & GraphNode > = full. nodes . iter ( ) . map ( |n| ( n. id . as_str ( ) , n) ) . collect ( ) ;
536543 let nodes = visible
537544 . iter ( )
538545 . filter_map ( |id| by_id. get ( id) . cloned ( ) . cloned ( ) )
0 commit comments