diff --git a/rmp-serde/src/config.rs b/rmp-serde/src/config.rs index c0394995..e03fcd7c 100644 --- a/rmp-serde/src/config.rs +++ b/rmp-serde/src/config.rs @@ -1,6 +1,6 @@ //! Change MessagePack behavior with configuration wrappers. -/// Represents configuration that dicatates what the serializer does. +/// Represents configuration that dictates what the serializer does. /// /// Implemented as an empty trait depending on a hidden trait in order to allow changing the /// methods of this trait without breaking backwards compatibility. @@ -148,7 +148,7 @@ where } } -/// Config wrapper that overrides struct serlization by packing as a tuple without field +/// Config wrapper that overrides struct serialization by packing as a tuple without field /// names. #[derive(Copy, Clone, Debug)] pub struct StructTupleConfig(C); diff --git a/rmp-serde/src/decode.rs b/rmp-serde/src/decode.rs index 382981c1..aefedefa 100644 --- a/rmp-serde/src/decode.rs +++ b/rmp-serde/src/decode.rs @@ -645,7 +645,7 @@ impl<'de, 'a, R: ReadSlice<'de>, C: SerializerConfig> serde::Deserializer<'de> f { // # Important // - // If a nested Option `o ∈ { Option>, Option>>, ..., Option...> }` + // If a nested Option `o ∈ { Option>, Option>>, ..., Option...> }` // is visited for the first time, the marker (read from the underlying Reader) will determine // `o`'s innermost type `t`. // For subsequent visits of `o` the marker will not be re-read again but kept until type `t` @@ -654,7 +654,7 @@ impl<'de, 'a, R: ReadSlice<'de>, C: SerializerConfig> serde::Deserializer<'de> f // # Note // // Round trips of Options where `Option = None` such as `Some(None)` will fail because - // they are just seriialized as `nil`. The serialization format has probably to be changed + // they are just serialized as `nil`. The serialization format has probably to be changed // to solve this. But as serde_json behaves the same, I think it's not worth doing this. let marker = self.take_or_read_marker()?; diff --git a/rmp-serde/src/encode.rs b/rmp-serde/src/encode.rs index f42b20b7..afea0f70 100644 --- a/rmp-serde/src/encode.rs +++ b/rmp-serde/src/encode.rs @@ -31,7 +31,7 @@ pub enum Error { //TODO: This can be removed at some point /// Failed to serialize struct, sequence or map, because its length is unknown. UnknownLength, - /// Invalid Data model, i.e. Serialize trait is not implmented correctly + /// Invalid Data model, i.e. Serialize trait is not implemented correctly InvalidDataModel(&'static str), /// Depth limit exceeded DepthLimitExceeded, @@ -266,7 +266,7 @@ impl Serializer { /// as a sequence of variable-size integers. /// /// This reduces overhead of binary data, but it may break - /// decodnig of some Serde types that happen to contain `[u8]`s, + /// decoding of some Serde types that happen to contain `[u8]`s, /// but don't implement Serde's `visit_bytes`. /// /// ```rust @@ -503,7 +503,7 @@ impl From<&Serializer> for UnknownLengthCompound { /// For the described case a `UnknownLengthCompound` is used to encode the elements. On `end()` /// the counted length and the encoded elements will be written to the `Serializer`. A caveat is, /// that structs that contain flattened fields arem always written as a map, even when compact -/// representaion is desired. +/// representation is desired. /// /// Otherwise, if the length is known, the elements will be encoded directly by the `Serializer`. #[derive(Debug)] diff --git a/rmp/src/decode/mod.rs b/rmp/src/decode/mod.rs index 8bc9719f..fccaee4a 100644 --- a/rmp/src/decode/mod.rs +++ b/rmp/src/decode/mod.rs @@ -129,7 +129,7 @@ pub trait RmpRead: sealed::Sealed { * HACK: rmpv & rmp-erde used the internal read_data_* functions. * * Since adding no_std support moved these functions to the RmpRead trait, - * this broke compatiblity (despite changing no public APIs). + * this broke compatibility (despite changing no public APIs). * * In theory, we could update rmpv and rmp-serde to use the new APIS, * but that would be needless churn (and might surprise users who just want to update rmp proper). diff --git a/rmp/src/decode/str.rs b/rmp/src/decode/str.rs index 6cfc02d9..a6bde509 100644 --- a/rmp/src/decode/str.rs +++ b/rmp/src/decode/str.rs @@ -143,7 +143,7 @@ pub fn read_str_data<'r, R>(rd: &mut R, /// Attempts to read and decode a string value from the reader, returning a borrowed slice from it. /// -// TODO: Also it's possible to implement all borrowing functions for all `BufRead` implementors. +// TODO: Also it's possible to implement all borrowing functions for all `BufRead` implementers. #[deprecated(since = "0.8.6", note = "useless, use `read_str_from_slice` instead")] pub fn read_str_ref(rd: &[u8]) -> Result<&[u8], DecodeStringError<'_, super::bytes::BytesReadError>> { let mut cur = super::Bytes::new(rd); diff --git a/rmp/src/encode/buffer.rs b/rmp/src/encode/buffer.rs index 4d26dbda..d369dd46 100644 --- a/rmp/src/encode/buffer.rs +++ b/rmp/src/encode/buffer.rs @@ -30,8 +30,8 @@ pub type FixedBufCapacityOverflow = std::io::Error; #[cfg(not(feature = "std"))] impl Display for FixedBufCapacityOverflow { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - // This is intentionally vauge because std::io::Error is - // Doesn't make sense for no_std to have bettetr errors than std + // This is intentionally vague because std::io::Error is + // Doesn't make sense for no_std to have better errors than std f.write_str("Capacity overflow for fixed-size byte buffer") } } @@ -69,7 +69,7 @@ impl<'a> RmpWrite for &'a mut [u8] { /// A wrapper around `Vec` to serialize more efficiently. /// /// This has a specialized implementation of `RmpWrite` -/// It gives `std::convert::Infailable` for errors. +/// It gives `std::convert::Infallible` for errors. /// This is because writing to `Vec` can only fail due to allocation. /// /// This has the additional benefit of working on `#[no_std]` diff --git a/rmp/src/encode/mod.rs b/rmp/src/encode/mod.rs index fc3a8d59..a0e9de0b 100644 --- a/rmp/src/encode/mod.rs +++ b/rmp/src/encode/mod.rs @@ -219,7 +219,7 @@ impl From> for ValueWriteError { } } -#[cfg(feature = "std")] // Backwards compatbility ;) +#[cfg(feature = "std")] // Backwards compatibility ;) impl From> for std::io::Error { #[cold] fn from(err: ValueWriteError) -> std::io::Error { diff --git a/rmp/tests/func/encode/ext.rs b/rmp/tests/func/encode/ext.rs index cb5c79bb..13c58904 100644 --- a/rmp/tests/func/encode/ext.rs +++ b/rmp/tests/func/encode/ext.rs @@ -29,7 +29,7 @@ fn pass_pack_meta_fix4() { } #[test] -fn pass_pack_meta_fix4_timesamp() { +fn pass_pack_meta_fix4_timestamp() { let mut buf = [0x00, 0x00]; assert_eq!(Marker::FixExt4, write_ext_meta(&mut &mut buf[..], 4, -1).unwrap()); assert_eq!([0xd6, 0xff], buf); diff --git a/rmpv/benches/value.rs b/rmpv/benches/value.rs index eacdd585..021d016c 100644 --- a/rmpv/benches/value.rs +++ b/rmpv/benches/value.rs @@ -124,7 +124,7 @@ fn from_complex_read_value_ref_to_owned(b: &mut Bencher) { /// Read a single large bin32 value. fn read_large_bin32(b: &mut Bencher, size: u32) { - // Creat buffer, fill it with bytes + // Create buffer, fill it with bytes let mut buf = Vec::with_capacity(size as usize); buf.resize(size as usize, 42); @@ -171,7 +171,7 @@ fn read_bin32_100mib(b: &mut Bencher) { /// Read a flat array containing positive 32-bit unsigned integers. fn read_large_array(b: &mut Bencher, element_count: usize) { - // Creat buffer, fill it with bytes + // Create buffer, fill it with bytes let size = element_count * 5 /* uint32 size */ + 5 /* array overhead */; let mut buf = Vec::with_capacity(size); buf.resize(size, 0);