Skip to content

Commit 1fa175f

Browse files
committed
use pub mod instead of pub use
this way everything is nicely structured and properly exposed.
1 parent 5113365 commit 1fa175f

File tree

8 files changed

+29
-15
lines changed

8 files changed

+29
-15
lines changed

src/accelerometer_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`AccelerometerEvent`] and its parsing from the protocol.
2+
13
use super::{try_f32_from_le_bytes, ProtocolParseError};
24

35
/// Represents an accelerometer event from the protocol.

src/button_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`ButtonEvent`] and its parsing from the protocol.
2+
13
use super::ProtocolParseError;
24

35
/// Errors which can be raised while parsing a button event.

src/color_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`ColorEvent`] and its parsing from the protocol.
2+
13
use super::ProtocolParseError;
24

35
/// Represents a color event from the protocol.

src/gyro_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`GyroEvent`] and its parsing from the protocol.
2+
13
use super::{try_f32_from_le_bytes, ProtocolParseError};
24

35
/// Represents a gyro event from the protocol.

src/lib.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
#![deny(unused)]
1111
#![no_std]
1212

13-
mod accelerometer_event;
14-
mod button_event;
15-
mod color_event;
16-
mod gyro_event;
17-
mod location_event;
18-
mod magnetometer_event;
19-
mod quaternion_event;
20-
21-
pub use accelerometer_event::AccelerometerEvent;
22-
pub use button_event::{Button, ButtonEvent, ButtonParseError, ButtonState};
23-
pub use color_event::ColorEvent;
13+
pub mod accelerometer_event;
14+
pub mod button_event;
15+
pub mod color_event;
16+
pub mod gyro_event;
17+
pub mod location_event;
18+
pub mod magnetometer_event;
19+
pub mod quaternion_event;
20+
21+
use accelerometer_event::AccelerometerEvent;
22+
use button_event::{ButtonEvent, ButtonParseError};
23+
use color_event::ColorEvent;
2424
use core::cmp::min;
25-
pub use gyro_event::GyroEvent;
25+
use gyro_event::GyroEvent;
2626
use heapless::Vec;
27-
pub use location_event::LocationEvent;
28-
pub use magnetometer_event::MagnetometerEvent;
29-
pub use quaternion_event::QuaternionEvent;
27+
use location_event::LocationEvent;
28+
use magnetometer_event::MagnetometerEvent;
29+
use quaternion_event::QuaternionEvent;
3030

3131
/// Lists all (supported) events which can be sent by the controller. These come with the parsed event data and are the result of a [`parse`] call.
3232
#[derive(PartialEq, Debug)]

src/location_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`LocationEvent`] and its parsing from the protocol.
2+
13
use super::{try_f32_from_le_bytes, ProtocolParseError};
24

35
/// Represents a location event from the protocol.

src/magnetometer_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`MagnetometerEvent`] and its parsing from the protocol.
2+
13
use super::{try_f32_from_le_bytes, ProtocolParseError};
24

35
/// Represents a magnetometer event from the protocol.

src/quaternion_event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Implements the [`QuaternionEvent`] and its parsing from the protocol.
2+
13
use super::{try_f32_from_le_bytes, ProtocolParseError};
24

35
/// Represents a [quaternion](https://en.wikipedia.org/wiki/Quaternion) event from the protocol.

0 commit comments

Comments
 (0)