From aebbe14e65324150fd28c19fd256e08915020057 Mon Sep 17 00:00:00 2001 From: Tomasz Pietrek Date: Sun, 20 Nov 2022 13:09:42 +0100 Subject: [PATCH] Fix typos Signed-off-by: Tomasz Pietrek --- .config/nats.dic | 5 ----- async-nats/CHANGELOG.md | 2 +- async-nats/src/jetstream/consumer/mod.rs | 10 +++++----- async-nats/src/jetstream/consumer/pull.rs | 2 +- async-nats/src/jetstream/consumer/push.rs | 4 ++-- async-nats/src/jetstream/publish.rs | 2 +- async-nats/src/jetstream/stream.rs | 4 ++-- async-nats/src/lib.rs | 2 +- async-nats/src/status.rs | 2 +- nats/nats_test_server/src/lib.rs | 2 +- nats/src/connect.rs | 2 +- nats/src/jetstream/mod.rs | 2 +- nats/src/jetstream/types.rs | 16 ++++++++-------- nats/src/message.rs | 6 +++--- 14 files changed, 28 insertions(+), 33 deletions(-) diff --git a/.config/nats.dic b/.config/nats.dic index da3780122..01480262d 100644 --- a/.config/nats.dic +++ b/.config/nats.dic @@ -63,11 +63,6 @@ get_raw_message max_bytes > = -'*', -'.', -.', -\* -& + 100ms 1ms diff --git a/async-nats/CHANGELOG.md b/async-nats/CHANGELOG.md index 69b8db172..8e38838eb 100644 --- a/async-nats/CHANGELOG.md +++ b/async-nats/CHANGELOG.md @@ -70,7 +70,7 @@ Hence it was renamed to `Event::Connected`, which describes the current state wi For consistency, `Event::Disconnect` was renamed to `Event::Disconnected`. ## Breaking changes -* Defer publish acknowledgements by @Jarema in https://github.com/nats-io/nats.rs/pull/644 +* Defer publish acknowledgments by @Jarema in https://github.com/nats-io/nats.rs/pull/644 * Add retry on initial connect by @Jarema in https://github.com/nats-io/nats.rs/pull/662 ## Added * Add support for mirrors and sources in Key Value Store by @Jarema in https://github.com/nats-io/nats.rs/pull/676 diff --git a/async-nats/src/jetstream/consumer/mod.rs b/async-nats/src/jetstream/consumer/mod.rs index afd94586b..e862175df 100644 --- a/async-nats/src/jetstream/consumer/mod.rs +++ b/async-nats/src/jetstream/consumer/mod.rs @@ -161,7 +161,7 @@ pub struct Info { pub ack_floor: SequenceInfo, /// The difference between delivered and acknowledged messages pub num_ack_pending: usize, - /// The number of messages re-sent after acknowledgement was not received within the configured + /// The number of messages re-sent after acknowledgment was not received within the configured /// time threshold pub num_redelivered: usize, /// The number of waiting @@ -198,7 +198,7 @@ pub struct Config { /// to be "push-based". This is analogous in some ways to a normal /// NATS subscription (rather than a queue subscriber) in that the /// consumer will receive all messages published to the stream that - /// the consumer is interested in. Acknowledgement policies such as + /// the consumer is interested in. Acknowledgment policies such as /// `AckPolicy::None` and `AckPolicy::All` may be enabled for such /// push-based consumers, which reduce the amount of effort spent /// tracking delivery. Combining `AckPolicy::All` with @@ -206,7 +206,7 @@ pub struct Config { /// optimizations. /// /// Setting `deliver_subject` to `None` will cause this consumer to - /// be "pull-based", and will require explicit acknowledgement of + /// be "pull-based", and will require explicit acknowledgment of /// each message. This is analogous in some ways to a normal NATS /// queue subscriber, where a message will be delivered to a single /// subscriber. Pull-based consumers are intended to be used for @@ -273,7 +273,7 @@ pub struct Config { /// The rate of message delivery in bits per second #[serde(default, skip_serializing_if = "is_default")] pub rate_limit: u64, - /// What percentage of acknowledgements should be samples for observability, 0-100 + /// What percentage of acknowledgments should be samples for observability, 0-100 #[serde(default, skip_serializing_if = "is_default")] pub sample_frequency: u8, /// The maximum number of waiting consumers. @@ -399,7 +399,7 @@ pub enum AckPolicy { #[serde(rename = "none")] None = 0, /// Acknowledges all messages with lower sequence numbers when a later - /// message is acknowledged. Useful for "batching" acknowledgement. + /// message is acknowledged. Useful for "batching" acknowledgment. #[serde(rename = "all")] All = 1, } diff --git a/async-nats/src/jetstream/consumer/pull.rs b/async-nats/src/jetstream/consumer/pull.rs index 952a7948a..dc4ae5af0 100644 --- a/async-nats/src/jetstream/consumer/pull.rs +++ b/async-nats/src/jetstream/consumer/pull.rs @@ -1465,7 +1465,7 @@ pub struct Config { /// The rate of message delivery in bits per second #[serde(default, skip_serializing_if = "is_default")] pub rate_limit: u64, - /// What percentage of acknowledgements should be samples for observability, 0-100 + /// What percentage of acknowledgments should be samples for observability, 0-100 #[serde(default, skip_serializing_if = "is_default")] pub sample_frequency: u8, /// The maximum number of waiting consumers. diff --git a/async-nats/src/jetstream/consumer/push.rs b/async-nats/src/jetstream/consumer/push.rs index 5f3d07155..c353f6bac 100644 --- a/async-nats/src/jetstream/consumer/push.rs +++ b/async-nats/src/jetstream/consumer/push.rs @@ -183,7 +183,7 @@ pub struct Config { /// The rate of message delivery in bits per second #[serde(default, skip_serializing_if = "is_default")] pub rate_limit: u64, - /// What percentage of acknowledgements should be samples for observability, 0-100 + /// What percentage of acknowledgments should be samples for observability, 0-100 #[serde(default, skip_serializing_if = "is_default")] pub sample_frequency: u8, /// The maximum number of waiting consumers. @@ -305,7 +305,7 @@ pub struct OrderedConfig { /// The rate of message delivery in bits per second #[serde(default, skip_serializing_if = "is_default")] pub rate_limit: u64, - /// What percentage of acknowledgements should be samples for observability, 0-100 + /// What percentage of acknowledgments should be samples for observability, 0-100 #[serde(default, skip_serializing_if = "is_default")] pub sample_frequency: u8, /// Only deliver headers without payloads. diff --git a/async-nats/src/jetstream/publish.rs b/async-nats/src/jetstream/publish.rs index 8292c4d58..600ef006e 100644 --- a/async-nats/src/jetstream/publish.rs +++ b/async-nats/src/jetstream/publish.rs @@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize}; use std::ops::Not; -/// `PublishAck` is an acknowledgement received after successfully publishing a message. +/// `PublishAck` is an acknowledgment received after successfully publishing a message. #[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct PublishAck { /// Name of stream the message was published to. diff --git a/async-nats/src/jetstream/stream.rs b/async-nats/src/jetstream/stream.rs index 5c5268c2d..844e2eb34 100644 --- a/async-nats/src/jetstream/stream.rs +++ b/async-nats/src/jetstream/stream.rs @@ -1191,7 +1191,7 @@ pub struct ClusterInfo { pub struct PeerInfo { /// The server name of the peer. pub name: String, - /// Indicates if the server is up to date and synchronised. + /// Indicates if the server is up to date and synchronized. pub current: bool, /// Nanoseconds since this peer was last seen. #[serde(with = "serde_nanos")] @@ -1203,7 +1203,7 @@ pub struct PeerInfo { pub lag: Option, } -/// The response generated by trying ot purge a stream. +/// The response generated by trying to purge a stream. #[derive(Debug, Serialize, Deserialize, Clone, Copy)] pub struct PurgeResponse { /// Whether the purge request was successful. diff --git a/async-nats/src/lib.rs b/async-nats/src/lib.rs index 8a4357fa0..763da5e8d 100644 --- a/async-nats/src/lib.rs +++ b/async-nats/src/lib.rs @@ -942,7 +942,7 @@ impl std::fmt::Display for ServerError { /// Info to construct a CONNECT message. #[derive(Clone, Debug, Serialize)] pub struct ConnectInfo { - /// Turns on +OK protocol acknowledgements. + /// Turns on +OK protocol acknowledgments. pub verbose: bool, /// Turns on additional strict format checking, e.g. for properly formed diff --git a/async-nats/src/status.rs b/async-nats/src/status.rs index edc4a1eac..63ec4b501 100644 --- a/async-nats/src/status.rs +++ b/async-nats/src/status.rs @@ -97,7 +97,7 @@ impl StatusCode { .ok_or_else(InvalidStatusCode::new) } - /// Converts a &[u8] to a status code + /// Converts a `&[u8]` to a status code pub fn from_bytes(src: &[u8]) -> Result { if src.len() != 3 { return Err(InvalidStatusCode::new()); diff --git a/nats/nats_test_server/src/lib.rs b/nats/nats_test_server/src/lib.rs index c1b9cbbcd..dc06ee848 100644 --- a/nats/nats_test_server/src/lib.rs +++ b/nats/nats_test_server/src/lib.rs @@ -41,7 +41,7 @@ fn is_empty_or_none(field: &Option) -> bool { #[doc(hidden)] #[allow(clippy::module_name_repetitions)] pub struct ConnectInfo { - /// Turns on +OK protocol acknowledgements. + /// Turns on +OK protocol acknowledgments. pub verbose: bool, /// Turns on additional strict format checking, e.g. for properly formed diff --git a/nats/src/connect.rs b/nats/src/connect.rs index 0277f2a41..e36a0e89d 100644 --- a/nats/src/connect.rs +++ b/nats/src/connect.rs @@ -18,7 +18,7 @@ use crate::SecureString; #[doc(hidden)] #[allow(clippy::module_name_repetitions)] pub struct ConnectInfo { - /// Turns on +OK protocol acknowledgements. + /// Turns on +OK protocol acknowledgments. pub verbose: bool, /// Turns on additional strict format checking, e.g. for properly formed diff --git a/nats/src/jetstream/mod.rs b/nats/src/jetstream/mod.rs index a4974c5a9..214780b6e 100644 --- a/nats/src/jetstream/mod.rs +++ b/nats/src/jetstream/mod.rs @@ -428,7 +428,7 @@ pub enum ErrorCode { ConsumerWQConsumerNotDeliverAll = 10101, /// Consumer name is too long, maximum allowed is {max} ConsumerNameTooLong = 10102, - /// Durable name can not contain '.', '*', '>' + /// Durable name can not contain `.`, `*`, `>` ConsumerBadDurableName = 10103, /// Error creating store for consumer: {err} ConsumerStoreFailed = 10104, diff --git a/nats/src/jetstream/types.rs b/nats/src/jetstream/types.rs index 088154221..8b5d588d4 100644 --- a/nats/src/jetstream/types.rs +++ b/nats/src/jetstream/types.rs @@ -145,7 +145,7 @@ pub struct ConsumerConfig { /// to be "push-based". This is analogous in some ways to a normal /// NATS subscription (rather than a queue subscriber) in that the /// consumer will receive all messages published to the stream that - /// the consumer is interested in. Acknowledgement policies such as + /// the consumer is interested in. Acknowledgment policies such as /// `AckPolicy::None` and `AckPolicy::All` may be enabled for such /// push-based consumers, which reduce the amount of effort spent /// tracking delivery. Combining `AckPolicy::All` with @@ -153,7 +153,7 @@ pub struct ConsumerConfig { /// optimizations. /// /// Setting `deliver_subject` to `None` will cause this consumer to - /// be "pull-based", and will require explicit acknowledgement of + /// be "pull-based", and will require explicit acknowledgment of /// each message. This is analogous in some ways to a normal NATS /// queue subscriber, where a message will be delivered to a single /// subscriber. Pull-based consumers are intended to be used for @@ -223,7 +223,7 @@ pub struct ConsumerConfig { /// The rate of message delivery in bits per second #[serde(default, skip_serializing_if = "is_default")] pub rate_limit: u64, - /// What percentage of acknowledgements should be samples for observability, 0-100 + /// What percentage of acknowledgments should be samples for observability, 0-100 #[serde(default, skip_serializing_if = "is_default")] pub sample_frequency: u8, /// The maximum number of waiting consumers. @@ -488,7 +488,7 @@ pub enum AckPolicy { #[serde(rename = "none")] None = 0, /// Acknowledges all messages with lower sequence numbers when a later - /// message is acknowledged. Useful for "batching" acknowledgement. + /// message is acknowledged. Useful for "batching" acknowledgment. #[serde(rename = "all")] All = 1, } @@ -536,7 +536,7 @@ pub struct PurgeRequest { pub keep: Option, } -/// The response generated by trying ot purge a stream. +/// The response generated by trying to purge a stream. #[derive(Debug, Serialize, Deserialize, Clone, Copy)] pub struct PurgeResponse { /// Whether the purge request was successful. @@ -626,7 +626,7 @@ pub(crate) struct AccountStats { pub limits: AccountLimits, } -/// `PublishAck` is an acknowledgement received after successfully publishing a message. +/// `PublishAck` is an acknowledgment received after successfully publishing a message. #[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct PublishAck { /// Name of stream the message was published to. @@ -697,7 +697,7 @@ pub struct ConsumerInfo { pub ack_floor: SequencePair, /// The difference between delivered and acknowledged messages pub num_ack_pending: usize, - /// The number of messages re-sent after acknowledgement was not received within the configured + /// The number of messages re-sent after acknowledgment was not received within the configured /// time threshold pub num_redelivered: usize, /// The number of waiting @@ -781,7 +781,7 @@ pub(crate) struct StreamNamesResponse { pub streams: Option>, } -/// Options to configure Pull Subsscription +/// Options to configure Pull Subscription #[derive(Debug, Default, Clone)] pub struct PullSubscribeOptions { pub(crate) stream_name: Option, diff --git a/nats/src/message.rs b/nats/src/message.rs index 5c9ab18cd..cb3970010 100644 --- a/nats/src/message.rs +++ b/nats/src/message.rs @@ -178,7 +178,7 @@ impl Message { false } - /// Acknowledge a `JetStream` message with a default acknowledgement. + /// Acknowledge a `JetStream` message with a default acknowledgment. /// See `AckKind` documentation for details of what other types of /// acks are available. If you need to send a non-default ack, use /// the `ack_kind` method below. If you need to block until the @@ -202,8 +202,8 @@ impl Message { self.respond(ack_kind) } - /// Acknowledge a `JetStream` message and wait for acknowledgement from the server - /// that it has received our ack. Retry acknowledgement until we receive a response. + /// Acknowledge a `JetStream` message and wait for acknowledgment from the server + /// that it has received our ack. Retry acknowledgment until we receive a response. /// See `AckKind` documentation for details of what each variant means. /// /// Returns immediately if this message has already been double-acked.