Skip to content

Commit

Permalink
docs: Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored Aug 9, 2023
1 parent 779b391 commit a1c3570
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/no_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ impl<T> crate::Inner<T> {
pub(crate) fn remove(
&self,
mut listener: Pin<&mut Option<Listener<T>>>,
propogate: bool,
propagate: bool,
) -> Option<State<T>> {
let state = match listener.as_mut().take() {
Some(Listener::HasNode(key)) => {
match self.try_lock() {
Some(mut list) => {
// Fast path removal.
list.remove(key, propogate)
list.remove(key, propagate)
}

None => {
// Slow path removal.
// This is why intrusive lists don't work on no_std.
let node = Node::RemoveListener {
listener: key,
propagate: propogate,
propagate,
};

self.list.queue.push(node);
Expand Down Expand Up @@ -500,7 +500,7 @@ impl<T> ListenerSlab<T> {
}

/// Removes an entry from the list and returns its state.
pub(crate) fn remove(&mut self, key: NonZeroUsize, propogate: bool) -> Option<State<T>> {
pub(crate) fn remove(&mut self, key: NonZeroUsize, propagate: bool) -> Option<State<T>> {
let entry = &self.listeners[key.get()];
let prev = entry.prev().get();
let next = entry.next().get();
Expand Down Expand Up @@ -538,8 +538,8 @@ impl<T> ListenerSlab<T> {
if state.is_notified() {
self.notified = self.notified.saturating_sub(1);

if propogate {
// Propogate the notification to the next entry.
if propagate {
// Propagate the notification to the next entry.
let state = mem::replace(&mut state, State::NotifiedTaken);
if let State::Notified { tag, additional } = state {
let tags = {
Expand Down Expand Up @@ -1247,7 +1247,7 @@ mod tests {
}
);

// Remove and propogate the second listener.
// Remove and propagate the second listener.
assert_eq!(listeners.remove(key2, true), Some(State::NotifiedTaken));

// The third listener should be notified.
Expand Down Expand Up @@ -1339,7 +1339,7 @@ mod tests {
inner.notify(GenericNotify::new(1, false, || ()));
assert!(woken.load(Ordering::SeqCst));

// Remove the second listener and propogate the notification.
// Remove the second listener and propagate the notification.
assert_eq!(
inner.remove(Pin::new(&mut listener2), true),
Some(State::NotifiedTaken)
Expand Down
2 changes: 1 addition & 1 deletion src/notify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl<T, F: FnMut() -> T> TagProducer for F {
/// This trait is implemented for all types that implement [`Notification`], as well as for non-floating-point
/// numeric literals (`usize`, `i32`, etc).
///
/// This function can be thought of as being analagous to [`std::iter::IntoIterator`], but for [`Notification`].
/// This function can be thought of as being analogous to [`std::iter::IntoIterator`], but for [`Notification`].
pub trait IntoNotification: __private::Sealed {
/// The tag data associated with a notification.
///
Expand Down
8 changes: 4 additions & 4 deletions src/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ impl<T> crate::Inner<T> {
pub(crate) fn remove(
&self,
listener: Pin<&mut Option<Listener<T>>>,
propogate: bool,
propagate: bool,
) -> Option<State<T>> {
self.lock().remove(listener, propogate)
self.lock().remove(listener, propagate)
}

/// Notifies a number of entries.
Expand Down Expand Up @@ -169,7 +169,7 @@ impl<T> Inner<T> {
fn remove(
&mut self,
mut listener: Pin<&mut Option<Listener<T>>>,
propogate: bool,
propagate: bool,
) -> Option<State<T>> {
let entry = unsafe {
// SAFETY: We never move out the `link` field.
Expand Down Expand Up @@ -219,7 +219,7 @@ impl<T> Inner<T> {
if state.is_notified() {
self.notified -= 1;

if propogate {
if propagate {
let state = mem::replace(&mut state, State::NotifiedTaken);
if let State::Notified { additional, tag } = state {
let tags = {
Expand Down

0 comments on commit a1c3570

Please sign in to comment.