Skip to content

Commit 84df588

Browse files
committed
rustfmt tweaks
1 parent 480fb93 commit 84df588

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

examples/gps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ A simple 2D pose slam example with "GPS" measurements
1212
#![allow(unused_imports)]
1313
// Our state will be represented by SE2 -> theta, x, y
1414
// VectorVar2 is a newtype around Vector2 for optimization purposes
15-
use factrs::variables::{VectorVar2, SE2};
1615
use factrs::{
1716
assign_symbols,
1817
core::{BetweenResidual, GaussNewton, Graph, Values},
1918
dtype, fac,
2019
linalg::{Const, ForwardProp, Numeric, NumericalDiff, VectorX},
2120
residuals::Residual1,
2221
traits::*,
22+
variables::{VectorVar2, SE2},
2323
};
2424

2525
#[derive(Clone, Debug)]

src/utils.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ pub fn load_g20(file: &str) -> (Graph, Values) {
6161
let m22 = parts[9].parse::<dtype>().expect("Failed to parse g20");
6262
let m23 = parts[10].parse::<dtype>().expect("Failed to parse g20");
6363
let m33 = parts[11].parse::<dtype>().expect("Failed to parse g20");
64-
// Note have to permute here - g2o stores with translation first, factrs with rotation first
64+
// Note have to permute here - g2o stores with translation first, factrs with
65+
// rotation first
6566
#[rustfmt::skip]
6667
let inf = Matrix3::new(
6768
m33, m13, m23,
@@ -135,7 +136,8 @@ pub fn load_g20(file: &str) -> (Graph, Values) {
135136
let m55 = parts[28].parse::<dtype>().expect("Failed to parse g20");
136137
let m56 = parts[29].parse::<dtype>().expect("Failed to parse g20");
137138
let m66 = parts[30].parse::<dtype>().expect("Failed to parse g20");
138-
// Note have to permute here - g2o stores with translation first, factrs with rotation first
139+
// Note have to permute here - g2o stores with translation first, factrs with
140+
// rotation first
139141
#[rustfmt::skip]
140142
let inf = Matrix6::new(
141143
m44, m45, m46, m14, m24, m34,

src/variables/traits.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ pub trait Variable: Clone + Sized + Display + Debug {
125125
other.inverse().compose(self)
126126
}
127127

128-
// TODO: This function is kind of ugly functions still
129-
// Would be nice if it wasn't a static function, but I couldn't ever get it quite right
130-
// Tried to add bound Self: Variable<T = DualVector<N>>, but it then I couldn't do custom impl
128+
// TODO: This function is kind of ugly still
129+
// It'd be nice if it used the dtype of the type itself instead of making a
130+
// dtype with a generic
131131

132132
/// Setup group element correctly using the tangent space
133133
///

tests/custom_variable.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,13 @@ factrs::test_variable!(MyVar);
7474

7575
#[cfg(feature = "serde")]
7676
mod ser_de {
77-
use super::*;
7877
use factrs::{
7978
assert_variable_eq, containers::Values, residuals::PriorResidual, symbols::X,
8079
traits::Residual, variables::VariableSafe,
8180
};
8281

82+
use super::*;
83+
8384
// Make sure it serializes properly
8485
#[test]
8586
fn test_json_serialize() {

0 commit comments

Comments
 (0)