Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
miratepuffin committed May 23, 2024
1 parent 90b4327 commit bb87b1b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 24 deletions.
13 changes: 11 additions & 2 deletions raphtory/src/db/api/view/edge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,11 +421,20 @@ mod test_edge_view {
.layer_name()
.all(|l| l.is_ok()));
assert!(graph.edges().explode().layer_name().all(|l| l.is_ok()));
assert!(graph.edges().explode_layers().layer_name().all(|l| l.is_ok()));
assert!(graph
.edges()
.explode_layers()
.layer_name()
.all(|l| l.is_ok()));

assert!(graph.edge(1, 2).unwrap().time().is_err());
assert!(graph.edges().time().all(|l| l.is_err()));
assert!(graph.edge(1, 2).unwrap().explode().time().all(|l| l.is_ok()));
assert!(graph
.edge(1, 2)
.unwrap()
.explode()
.time()
.all(|l| l.is_ok()));
assert!(graph
.edge(1, 2)
.unwrap()
Expand Down
44 changes: 22 additions & 22 deletions raphtory/src/db/graph/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2018,18 +2018,18 @@ mod db_tests {
fn test<G: StaticGraphViewOps>(graph: &G) {
let e = graph.edge(1, 2).expect("edge");

let layer_exploded = e
.explode_layers()
.iter()
.flat_map(|e| {
e.explode().iter().filter_map(|e| {
e.edge
.layer()
.zip(e.time().ok())
.map(|(layer, t)| (t, e.src().id(), e.dst().id(), *layer))
let layer_exploded = e
.explode_layers()
.iter()
.flat_map(|e| {
e.explode().iter().filter_map(|e| {
e.edge
.layer()
.zip(e.time().ok())
.map(|(layer, t)| (t, e.src().id(), e.dst().id(), *layer))
})
})
})
.collect::<Vec<_>>();
.collect::<Vec<_>>();

assert_eq!(
layer_exploded,
Expand Down Expand Up @@ -2057,18 +2057,18 @@ mod db_tests {
let g = graph.window(0, 3);
let e = g.edge(1, 2).expect("edge");

let layer_exploded = e
.explode_layers()
.iter()
.flat_map(|e| {
e.explode().iter().filter_map(|e| {
e.edge
.layer()
.zip(Some(e.time().unwrap()))
.map(|(layer, t)| (t, e.src().id(), e.dst().id(), *layer))
let layer_exploded = e
.explode_layers()
.iter()
.flat_map(|e| {
e.explode().iter().filter_map(|e| {
e.edge
.layer()
.zip(Some(e.time().unwrap()))
.map(|(layer, t)| (t, e.src().id(), e.dst().id(), *layer))
})
})
})
.collect::<Vec<_>>();
.collect::<Vec<_>>();

assert_eq!(
layer_exploded,
Expand Down

0 comments on commit bb87b1b

Please sign in to comment.