Skip to content

Commit 411eb1d

Browse files
author
Jerry Wang
committed
fix: typos
1 parent bd66838 commit 411eb1d

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ZooKeeper client writes in async rust.
1010
## Features
1111
* No callbacks.
1212
* No catch-all watcher.
13-
* `StateWatcher` trackes session state updates.
13+
* `StateWatcher` tracks session state updates.
1414
* `OneshotWatcher` tracks oneshot ZooKeeper node event.
1515
* `PersistentWatcher` tracks persistent and recursive persistent ZooKeeper node events.
1616
* No event type `XyzWatchRemoved` as there is no way to receive such event after watchers dropped.

src/acl.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -209,18 +209,18 @@ impl<'a> Acls<'a> {
209209
Self { inner: AclsInner::Acls { acls } }
210210
}
211211

212-
/// Returns acls that expresse anyone can have full permissions over nodes created by this
212+
/// Returns acls that expresses anyone can have full permissions over nodes created by this
213213
/// session.
214214
pub const fn anyone_all() -> Acls<'static> {
215215
Acls { inner: AclsInner::AnyoneAll }
216216
}
217217

218-
/// Returns acls that expresse anyone can read nodes created by this session.
218+
/// Returns acls that expresses anyone can read nodes created by this session.
219219
pub const fn anyone_read() -> Acls<'static> {
220220
Acls { inner: AclsInner::AnyoneRead }
221221
}
222222

223-
/// Returns acls that expresse anyone who has same auth as creator can have full permisssions
223+
/// Returns acls that expresses anyone who has same auth as creator can have full permissions
224224
/// over nodes created by this session.
225225
pub const fn creator_all() -> Acls<'static> {
226226
Acls { inner: AclsInner::CreatorAll }

src/client/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub struct CreateOptions<'a> {
132132
ttl: Option<Duration>,
133133
}
134134

135-
// Five bytes are avaiable for milliseconds. See javadoc of EphemeralType in ZooKeeper for reference.
135+
// Five bytes are available for milliseconds. See javadoc of EphemeralType in ZooKeeper for reference.
136136
//
137137
// https://github.com/apache/zookeeper/blob/ebcf18e52fa095773429348ce495d59c896f4a26/zookeeper-server/src/main/java/org/apache/zookeeper/server/EphemeralType.java#L46
138138
const TTL_MAX_MILLIS: u128 = 0x00FFFFFFFFFF;
@@ -849,7 +849,7 @@ impl Client {
849849
/// * Holds returned watcher without polling events may result in memory burst.
850850
/// * At the time of written, ZooKeeper [ZOOKEEPER-4466][] does not support oneshot and
851851
/// persistent watch on same path.
852-
/// * Persistent watch could loss events during reconnection due to [ZOOKEEPER-4698][].
852+
/// * Persistent watch could lose events during reconnection due to [ZOOKEEPER-4698][].
853853
///
854854
/// [ZOOKEEPER-4466]: https://issues.apache.org/jira/browse/ZOOKEEPER-4466
855855
/// [ZOOKEEPER-4698]: https://issues.apache.org/jira/browse/ZOOKEEPER-4698
@@ -898,7 +898,7 @@ impl Client {
898898
})
899899
}
900900

901-
/// Authenticates session using given scheme and auth identication. This affects only
901+
/// Authenticates session using given scheme and auth identification. This affects only
902902
/// subsequent operations.
903903
///
904904
/// # Errors
@@ -907,7 +907,7 @@ impl Client {
907907
///
908908
/// # Notable behaviors
909909
/// * Same auth will be resubmitted for authentication after session reestablished.
910-
/// * This method is resistent to temporary session unavailability, that means
910+
/// * This method is resistant to temporary session unavailability, that means
911911
/// [SessionState::Disconnected] will not end authentication.
912912
/// * It is ok to ignore resulting future of this method as request is sending synchronously
913913
/// and auth failure will fail ZooKeeper session with [SessionState::AuthFailed].
@@ -1122,7 +1122,7 @@ impl Client {
11221122
///
11231123
/// # Asynchronous ordering
11241124
/// Comparing to other data operations, e.g. [Client::create], this operation is pure
1125-
/// asynchronous, so there is no data order guaranttee.
1125+
/// asynchronous, so there is no data order guarantee.
11261126
///
11271127
/// # Error handling on [Error::ConnectionLoss]
11281128
/// * If connection loss during lock path creation, this method will find out the created lock
@@ -1219,7 +1219,7 @@ enum LockPrefixInner<'a> {
12191219
Shared { prefix: &'a str },
12201220
}
12211221

1222-
// It is intentional for this to not `Clone` as it is non sense for [LockPrefix::new_custom], and I
1222+
// It is intentional for this to not `Clone` as it is nonsense for [LockPrefix::new_custom], and I
12231223
// don't want to complicate this anymore, e.g. `LockPatternPrefix` and `LockCustomPrefix`. The side
12241224
// effect is that it is not easy to share `LockPrefix`. But, let the caller/tester to bore about that.
12251225
//
@@ -1731,7 +1731,7 @@ impl<'a> MultiReader<'a> {
17311731
/// Commits multiple operations in one request to reach consistent read.
17321732
///
17331733
/// # Notable behaviors
1734-
/// Individual errors(eg. [Error::NoNode]) are reported individually through [MultiReadResult::Error].
1734+
/// Individual errors(e.g. [Error::NoNode]) are reported individually through [MultiReadResult::Error].
17351735
pub fn commit(&mut self) -> impl Future<Output = Result<Vec<MultiReadResult>>> + Send + 'a {
17361736
let request = self.build_request();
17371737
Client::resolve(self.commit_internally(request))

src/client/watcher.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl StateWatcher {
2626
/// This method will block indefinitely after one of terminal states consumed.
2727
pub async fn changed(&mut self) -> SessionState {
2828
if self.receiver.changed().await.is_err() {
29-
// Terminal state must be deliveried.
29+
// Terminal state must be delivered.
3030
std::future::pending().await
3131
}
3232
self.state()
@@ -106,7 +106,7 @@ impl PersistentWatcher {
106106
/// Removes this watcher.
107107
///
108108
/// # Cautions
109-
/// It is a best effect as ZooKeper ([ZOOKEEPER-4472][]) does not support persistent watch
109+
/// It is a best effect as ZooKeeper ([ZOOKEEPER-4472][]) does not support persistent watch
110110
/// removing individually.
111111
///
112112
/// [ZOOKEEPER-4472]: https://issues.apache.org/jira/browse/ZOOKEEPER-4472

src/proto/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub enum PredefinedXid {
1111
Ping = -2,
1212

1313
/// Fortunately, ZooKeeper server [use xid from header](auth-xid) to reply auth request, so we can have
14-
/// multiple auth requets in network.
14+
/// multiple auth requests in network.
1515
///
1616
/// auth-xid: https://github.com/apache/zookeeper/blob/de7c5869d372e46af43979134d0e30b49d2319b1/zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java#L1621
1717
Auth = -4,

src/session/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl Session {
492492
Err(Error::ConnectionLoss)
493493
},
494494
Ok(sock) => {
495-
log::debug!("ZooKeeper succeeds in connectiong to {}:{}", addr.0, addr.1);
495+
log::debug!("ZooKeeper succeeds in connecting to {}:{}", addr.0, addr.1);
496496
Ok((sock, addr))
497497
},
498498
}

src/session/watch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ impl WatchManager {
360360
}
361361
}
362362
if !has_watch {
363-
// Probably a dangling peristent watcher.
363+
// Probably a dangling persistent watcher.
364364
depot.push_remove_watch(event.path, WatchMode::Any, StateResponser::none());
365365
}
366366
}

0 commit comments

Comments
 (0)