Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor spelling fixes. #357

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rmp-serde/src/config.rs
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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>(C);
Expand Down
4 changes: 2 additions & 2 deletions rmp-serde/src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ impl<'de, 'a, R: ReadSlice<'de>, C: SerializerConfig> serde::Deserializer<'de> f
{
// # Important
//
// If a nested Option `o ∈ { Option<Opion<t>>, Option<Option<Option<t>>>, ..., Option<Option<...Option<t>...> }`
// If a nested Option `o ∈ { Option<Option<t>>, Option<Option<Option<t>>>, ..., Option<Option<...Option<t>...> }`
// 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`
Expand All @@ -654,7 +654,7 @@ impl<'de, 'a, R: ReadSlice<'de>, C: SerializerConfig> serde::Deserializer<'de> f
// # Note
//
// Round trips of Options where `Option<t> = 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()?;

Expand Down
6 changes: 3 additions & 3 deletions rmp-serde/src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -266,7 +266,7 @@ impl<W: Write, C> Serializer<W, C> {
/// 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
Expand Down Expand Up @@ -503,7 +503,7 @@ impl<W, C: SerializerConfig> From<&Serializer<W, C>> 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)]
Expand Down
2 changes: 1 addition & 1 deletion rmp/src/decode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion rmp/src/decode/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions rmp/src/encode/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
Expand Down Expand Up @@ -69,7 +69,7 @@ impl<'a> RmpWrite for &'a mut [u8] {
/// A wrapper around `Vec<u8>` 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<T>` can only fail due to allocation.
///
/// This has the additional benefit of working on `#[no_std]`
Expand Down
2 changes: 1 addition & 1 deletion rmp/src/encode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl<E: RmpWriteErr> From<DataWriteError<E>> for ValueWriteError<E> {
}
}

#[cfg(feature = "std")] // Backwards compatbility ;)
#[cfg(feature = "std")] // Backwards compatibility ;)
impl From<ValueWriteError<std::io::Error>> for std::io::Error {
#[cold]
fn from(err: ValueWriteError<std::io::Error>) -> std::io::Error {
Expand Down
2 changes: 1 addition & 1 deletion rmp/tests/func/encode/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions rmpv/benches/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);
Expand Down