···290290 duration: u32,
291291 ) -> Result<Vec<HardwareCommand>, ButtplugDeviceError> {
292292 let previous_position = self.previous_position.load(Ordering::Relaxed);
293293- let distance = (previous_position as i32 - position as i32).abs() as u32;
293293+ let distance = (previous_position as i32 - position as i32).unsigned_abs();
294294 // The Fredorch only has 15 positions, but scales them to 0-150
295295 let pos = (position * 10) as u8;
296296
···196196 if let Ok(loaded_user_config) = user_device_config_pair
197197 .config()
198198 .build_from_base_definition(base_config.1)
199199- {
200200- if let Err(e) = dcm_builder
199199+ && let Err(e) = dcm_builder
201200 .user_device_definition(user_device_config_pair.identifier(), &loaded_user_config)
202201 {
203202 error!(
···205204 e, user_config
206205 )
207206 }
208208- }
209207 } else {
210208 error!(
211209 "Device identifier {:?} does not have a match base identifier that matches anything in the base config, removing from database.",
+3-4
crates/intiface_engine/src/bin/main.rs
···217217 "Intiface CLI Options: User Device Config {}",
218218 userdeviceconfig
219219 );
220220- builder.user_device_config_path(&userdeviceconfig);
220220+ builder.user_device_config_path(userdeviceconfig);
221221 match fs::read_to_string(userdeviceconfig) {
222222 Ok(cfg) => {
223223 builder.user_device_config_json(&cfg);
···267267 if let Some(value) = args.rest_api_port() {
268268 builder.rest_api_port(*value);
269269 }
270270- if args.broadcast_server_mdns() {
271271- if let Some(value) = args.mdns_suffix() {
270270+ if args.broadcast_server_mdns()
271271+ && let Some(value) = args.mdns_suffix() {
272272 builder.mdns_suffix(value);
273273 }
274274- }
275274 Ok(builder.finish())
276275 }
277276}