From db4b4d990d16b5cbf69007aa2791cc9ee4bde046 Mon Sep 17 00:00:00 2001 From: Robert Sammelson Date: Wed, 31 May 2023 21:23:54 -0400 Subject: [PATCH] Fix errors in doc comments --- src/commands/mod.rs | 12 ++++++------ src/commands/types.rs | 2 +- src/device/elm327.rs | 6 +++--- src/error.rs | 2 +- src/interface.rs | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/commands/mod.rs b/src/commands/mod.rs index b152b6f..1265eb9 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -19,21 +19,21 @@ use crate::{Obd2Device, Result}; func! { /// Trait for devices that can retrieve data over OBD-II /// - /// Automatically implemented for implementors of [odb2::Obd2Device](crate::Obd2Device), and + /// Automatically implemented for implementers of [odb2::Obd2Device](crate::Obd2Device), and /// currently cannot be otherwise implemented. trait Obd2DataRetrieval; { - /// Retreive the VIN (vehicle identification number) + /// Retrieve the VIN (vehicle identification number) /// - /// This should match the number printed on the vehicle, and is a good - /// command for checking that the OBD-II interface is working correctly. + /// This should match the number printed on the vehicle, and is a good command for checking + /// that the OBD-II interface is working correctly. fn get_vin(self, 0x09, 0x02) -> Result { implementation::get_vin(self) } } - /// Get DTCs for each ECU + /// Get list of DTCs for each ECU fn get_dtcs(0x03) -> Vec; /// Get service 1 PID support for $01 to $20 @@ -88,7 +88,7 @@ func! { /// Get the fuel pressure in kPa /// - /// This measurement is gauge pressure (measured relative to the atmosphere) + /// This measurement is gauge pressure (measured relative to the atmosphere). fn get_fuel_pressure(0x01, 0x0A, |v: i16| v * 3) -> i16; /// Get the intake manifold pressure in kPa diff --git a/src/commands/types.rs b/src/commands/types.rs index 8ee784d..5c10d8b 100644 --- a/src/commands/types.rs +++ b/src/commands/types.rs @@ -59,7 +59,7 @@ impl fmt::Display for Dtc { } } -/// Data retreived when reading an oxygen sensor +/// Data retrieved when reading an oxygen sensor pub struct OxygenSensorData { /// The current voltage reading (V) pub voltage: f32, diff --git a/src/device/elm327.rs b/src/device/elm327.rs index 98e4f90..83543a6 100644 --- a/src/device/elm327.rs +++ b/src/device/elm327.rs @@ -55,9 +55,9 @@ impl Obd2Reader for Elm327 { /// Read data until the ELM327's prompt character is printed /// - /// This will recieve the entire OBD-II response. The prompt signifies that the ELM327 is ready + /// This will receive the entire OBD-II response. The prompt signifies that the ELM327 is ready /// for another command. If this is not called after each OBD-II command is sent, the prompt - /// character will come out of the recieve queue later and because it is not valid hex this + /// character will come out of the receive queue later and because it is not valid hex this /// could cause problems. If a timeout occurs, `Ok(None)` will be returned. fn get_response(&mut self) -> Result>> { self.get_until(b'>', true) @@ -279,7 +279,7 @@ impl Elm327 { .map(|o| o.and_then(|resp| String::from_utf8(resp).ok())) } - /// Function for sendinga a raw string, without encoding into ASCII hex + /// Function for sending a raw string, without encoding into ASCII hex fn send_serial_str(&mut self, data: &str) -> Result<()> { trace!("send_serial_str: sending {:?}", data); diff --git a/src/error.rs b/src/error.rs index 87950da..6feac68 100644 --- a/src/error.rs +++ b/src/error.rs @@ -3,7 +3,7 @@ pub type Result = std::result::Result; /// An error with OBD-II communication #[derive(thiserror::Error, Debug)] pub enum Error { - /// An error occured in the [Odb2BaseDevice](crate::device::Obd2BaseDevice) + /// An error occurred in the [Odb2BaseDevice](crate::device::Obd2BaseDevice) #[error("Device error: `{0:?}`")] Device(DeviceError), diff --git a/src/interface.rs b/src/interface.rs index a74944f..5d49c0b 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -4,7 +4,7 @@ use super::{device::Obd2BaseDevice, Error, Obd2Device, Result}; /// An OBD-II interface /// -/// Wraps an implementor of [Obd2BaseDevice] to allow for higher-level usage of the OBD-II +/// Wraps an implementer of [Obd2BaseDevice] to allow for higher-level usage of the OBD-II /// interface. #[derive(Default)] pub struct Obd2 {