Skip to content

Commit f2365a3

Browse files
Fix tests.
1 parent 35d74e7 commit f2365a3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ fn main() {
5353

5454
```rust
5555
use rustypot::servo::feetech::sts3215::STS3215Controller;
56+
use std::time::Duration;
5657

5758
fn main() {
5859
let serial_port = serialport::new("/dev/ttyUSB0", 1_000_000)

src/dynamixel_protocol/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl DynamixelProtocolHandler {
3131
///
3232
/// # Examples
3333
/// ```no_run
34-
/// use rustypot::{DynamixelProtocolHandler, device::mx};
34+
/// use rustypot::{DynamixelProtocolHandler, servo::dynamixel::mx};
3535
/// use std::time::Duration;
3636
///
3737
/// let mut serial_port = serialport::new("/dev/ttyACM0", 1_000_000)
@@ -57,7 +57,7 @@ impl DynamixelProtocolHandler {
5757
///
5858
/// # Examples
5959
/// ```no_run
60-
/// use rustypot::{DynamixelProtocolHandler, device::xl320};
60+
/// use rustypot::{DynamixelProtocolHandler, servo::dynamixel::xl320};
6161
/// use std::time::Duration;
6262
///
6363
/// let mut serial_port = serialport::new("/dev/ttyACM0", 1_000_000)

src/lib.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,21 @@
3838
//! ### With the high-level API
3939
//! ```no_run
4040
//! use rustypot::servo::feetech::sts3215::STS3215Controller;
41+
//! use std::time::Duration;
4142
//!
42-
//! let serial_port = serialport::new(serialportname, baudrate)
43+
//! let serial_port = serialport::new("/dev/ttyUSB0", 1_000_000)
4344
//! .timeout(Duration::from_millis(1000))
44-
//! .open()?;
45+
//! .open()
46+
//! .unwrap();
4547
//!
4648
//! let mut c = STS3215Controller::new()
4749
//! .with_protocol_v1()
4850
//! .with_serial_port(serial_port);
4951
//!
50-
//! let pos = c.read_present_position(&vec![1, 2])?;
52+
//! let pos = c.read_present_position(&vec![1, 2]).unwrap();
5153
//! println!("Motors present position: {:?}", pos);
5254
//!
53-
//! c.write_goal_position(&vec![1, 2], &vec![1000, 2000])?;
55+
//! c.write_goal_position(&vec![1, 2], &vec![1000, 2000]).unwrap();
5456
//! ```
5557
5658
pub mod servo;
@@ -59,3 +61,5 @@ mod dynamixel_protocol;
5961
pub use dynamixel_protocol::{CommunicationErrorKind, DynamixelProtocolHandler};
6062

6163
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
64+
65+
// TODO: clippy

0 commit comments

Comments
 (0)