You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In crate truck-geotrait, truck-master/truck-geotrait/src/algo/surface.rs and truck-master/truck-geotrait/src/algo/curve.rs,
/// # Panics////// `tol` must be more than `TOLERANCE`.#[inline(always)]pubfnparameter_division<S>(surface:&S,(urange, vrange):((f64,f64),(f64,f64)),tol:f64,) -> (Vec<f64>,Vec<f64>)whereS:ParametricSurface,S::Point:EuclideanSpace<Scalar = f64> + MetricSpace<Metric = f64> + HashGen<f64>,{nonpositive_tolerance!(tol);let(mut udiv,mut vdiv) = (vec![urange.0, urange.1],vec![vrange.0, vrange.1]);sub_parameter_division(surface,(&mut udiv,&mut vdiv), tol);(udiv, vdiv)}
/// # Panics////// `tol` must be more than `TOLERANCE`.pubfnparameter_division<C>(curve:&C,range:(f64,f64),tol:f64) -> (Vec<f64>,Vec<C::Point>)whereC:ParametricCurve,C::Point:EuclideanSpace<Scalar = f64> + MetricSpace<Metric = f64> + HashGen<f64>,{nonpositive_tolerance!(tol);sub_parameter_division(
curve,
range,(curve.subs(range.0), curve.subs(range.1)),
tol,100,)}
above 2 functions' comments indicate tol must > TOLERANCE otherwise they will panic while actually code will not panic when tol = TOLERANCE.
macro_rules! nonpositive_tolerance {($tol: expr, $minimum: expr) => {
assert!(
$tol >= $minimum,"tolerance must be no less than {:e}",
$minimum
);};($tol: expr) => {
nonpositive_tolerance!($tol,TOLERANCE)};}
In truck-master/truck-platform/src/buffer_handler.rs,
The comment indicates that code will panic when dest.size < self.size while code panic when self.size < dest.size and assertion message indicates that dest.size must < self.size otherwise it will panic, those three are inconsistent.
/// Copy the values of buffer to `dest`./// # Panic/// Panic occurs if the size of `dest` is smaller than the one of `self`.#[inline(always)]pubfncopy_buffer(&self,encoder:&mutCommandEncoder,dest:&BufferHandler){assert!(self.size < dest.size,"The destination buffer size must be shorter than the source buffer size.");
encoder.copy_buffer_to_buffer(&self.buffer,0,&dest.buffer,0,self.size);}
The text was updated successfully, but these errors were encountered:
In crate truck-geotrait, truck-master/truck-geotrait/src/algo/surface.rs and truck-master/truck-geotrait/src/algo/curve.rs,
above 2 functions' comments indicate tol must > TOLERANCE otherwise they will panic while actually code will not panic when tol = TOLERANCE.
In truck-master/truck-platform/src/buffer_handler.rs,
The comment indicates that code will panic when dest.size < self.size while code panic when self.size < dest.size and assertion message indicates that dest.size must < self.size otherwise it will panic, those three are inconsistent.
The text was updated successfully, but these errors were encountered: