Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
chore: fmt :trollface:
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropix126 committed Mar 13, 2024
1 parent 7e7f4f1 commit 5f36c18
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/pros-devices/src/adi/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
use pros_core::bail_on;
use pros_sys::{ext_adi_encoder_t, PROS_ERR};

use crate::Position;

use super::{AdiDevice, AdiDeviceType, AdiError, AdiPort};
use crate::Position;

/// ADI encoder device.
/// Requires two adi ports.
Expand Down Expand Up @@ -52,9 +51,7 @@ impl AdiEncoder {

/// Gets the number of ticks recorded by the encoder.
pub fn position(&self) -> Result<Position, AdiError> {
let degrees = bail_on!(PROS_ERR, unsafe {
pros_sys::adi_encoder_get(self.raw)
});
let degrees = bail_on!(PROS_ERR, unsafe { pros_sys::adi_encoder_get(self.raw) });

Ok(Position::from_degrees(degrees as f64))
}
Expand Down

0 comments on commit 5f36c18

Please sign in to comment.