Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
eadf committed Feb 22, 2021
1 parent 889358d commit 88310d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/beachline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use super::predicate as VP;
use super::siteevent as VSE;

use super::{BigFloatType, BigIntType, InputType, OutputType};
use crate::BvError;
use std::cell::Cell;
use std::cmp::Ordering;
use std::collections::BTreeMap;
Expand All @@ -26,7 +27,6 @@ use std::ops::Bound::{Excluded, Included, Unbounded};
use std::ops::Neg;
use std::rc::Rc;
use vec_map::VecMap;
use crate::BvError;

/// debug utility function
pub(crate) fn debug_print_bli_id(value: Option<BeachLineIndex>) -> String {
Expand Down Expand Up @@ -117,15 +117,17 @@ where
key
}

pub(crate) fn erase(&mut self, beachline_index: BeachLineIndex) -> Result<(),BvError>{
pub(crate) fn erase(&mut self, beachline_index: BeachLineIndex) -> Result<(), BvError> {
//todo is this correct?
if let Some(node) = self.beach_line_vec.get(beachline_index.0) {
let node = node.0;
if self.beach_line_.remove(&node).is_none() {
return Err(BvError::SelfIntersecting {txt:"Tried to remove a non-existent beachline, this error can occur if the input data is self-intersecting".to_string()});
}
if self.beach_line_.contains_key(&node) {
return Err(BvError::SomeError {txt:"Beachline: internal error there are more identical keys".to_string()});
return Err(BvError::SomeError {
txt: "Beachline: internal error there are more identical keys".to_string(),
});
}
let _ = self.beach_line_vec.remove(beachline_index.0);
} else {
Expand Down
9 changes: 6 additions & 3 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,11 @@ where
}
}

pub(crate) fn process_site_event (
pub(crate) fn process_site_event(
&mut self,
site_event_iterator_: &mut VSE::SiteEventIndexType,
output: &mut VD::VoronoiDiagram<I1, F1, I2, F2>,
) -> Result<(),BvError> {
) -> Result<(), BvError> {
let (mut right_it, last_index) = {
// Get next site event to process.
let site_event = self.site_events_.get(*site_event_iterator_).unwrap();
Expand Down Expand Up @@ -455,7 +455,10 @@ where
/// why we use const_cast there and take all the responsibility that
/// map data structure keeps correct ordering.
#[allow(clippy::unnecessary_unwrap)]
pub(crate) fn process_circle_event(&mut self, output: &mut VD::VoronoiDiagram<I1, F1, I2, F2>) -> Result<(),BvError> {
pub(crate) fn process_circle_event(
&mut self,
output: &mut VD::VoronoiDiagram<I1, F1, I2, F2>,
) -> Result<(), BvError> {
// Get the topmost circle event.
let e = self.circle_events_.top().unwrap();
let circle_event = e.0.get();
Expand Down
5 changes: 2 additions & 3 deletions tests/segment_test_4.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use boostvoronoi::builder::Builder;
use boostvoronoi::{BvError, InputType};
use boostvoronoi::Line;
use boostvoronoi::{BvError, InputType};

type I1 = i32;
type F1 = f64;
Expand All @@ -21,7 +21,7 @@ fn to_segments<T: InputType>(points: &[[T; 4]]) -> Vec<Line<T>> {
}

#[test]
fn segment_4_1_intersecting() {
fn segment_4_1_intersecting() {
let _output = {
let segments: [[I1; 4]; 9] = [
[207, 208, 405, 400],
Expand All @@ -43,7 +43,6 @@ fn segment_4_1_intersecting() {
_output.expect_err("should fail");
}


#[ignore]
#[test]
fn segment_4_1() -> Result<(), BvError> {
Expand Down

0 comments on commit 88310d5

Please sign in to comment.