Skip to content

Commit 719197b

Browse files
committed
RosOpenCvIntrinsics: simplify Debug impl
Removed redundant information from output.
1 parent 8b396cf commit 719197b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub type Result<T> = std::result::Result<T, Error>;
192192
/// field.
193193
///
194194
/// See the [module-level documentation for more information](index.html).
195-
#[derive(Debug, Clone, PartialEq)]
195+
#[derive(Clone, PartialEq)]
196196
pub struct RosOpenCvIntrinsics<R: RealField> {
197197
/// If these intrinsics have zero skew, they are "opencv compatible" and this is `true`.
198198
pub is_opencv_compatible: bool,
@@ -207,6 +207,16 @@ pub struct RosOpenCvIntrinsics<R: RealField> {
207207
cache: Cache<R>,
208208
}
209209

210+
impl<R: RealField> std::fmt::Debug for RosOpenCvIntrinsics<R> {
211+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
212+
f.debug_struct("RosOpenCvIntrinsics")
213+
.field("p", &self.p)
214+
.field("distortion", &self.distortion)
215+
.field("rect", &self.rect)
216+
.finish()
217+
}
218+
}
219+
210220
impl<R: RealField> From<cam_geom::IntrinsicParametersPerspective<R>> for RosOpenCvIntrinsics<R> {
211221
fn from(orig: cam_geom::IntrinsicParametersPerspective<R>) -> Self {
212222
Self::from_params(orig.fx(), orig.skew(), orig.fy(), orig.cx(), orig.cy())

0 commit comments

Comments
 (0)