Skip to content

Commit

Permalink
style: satisfy clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Jan 27, 2025
1 parent bf162d9 commit 86c601a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions elfo-core/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ impl<'c, C, K, R> RequestBuilder<'c, C, K, R, Any> {
}
}

impl<'c, C, K, R: Request, M> RequestBuilder<'c, C, K, R, M> {
impl<C, K, R: Request, M> RequestBuilder<'_, C, K, R, M> {
/// Specified the recipient of the request.
#[inline]
fn to(mut self, addr: Addr) -> Self {
Expand All @@ -1156,7 +1156,7 @@ impl<'c, C, K, R: Request, M> RequestBuilder<'c, C, K, R, M> {
}

// TODO: add `pub async fn id() { ... }`
impl<'c, C: 'static, K, R: Request> RequestBuilder<'c, C, K, R, Any> {
impl<C: 'static, K, R: Request> RequestBuilder<'_, C, K, R, Any> {
/// Waits for the response.
pub async fn resolve(self) -> Result<R::Response, RequestError> {
// TODO: use `context.actor` after removing pruned contexts.
Expand All @@ -1181,7 +1181,7 @@ impl<'c, C: 'static, K, R: Request> RequestBuilder<'c, C, K, R, Any> {
}
}

impl<'c, C: 'static, K, R: Request> RequestBuilder<'c, C, K, R, All> {
impl<C: 'static, K, R: Request> RequestBuilder<'_, C, K, R, All> {
/// Waits for the responses.
pub async fn resolve(self) -> Vec<Result<R::Response, RequestError>> {
// TODO: use `context.actor` after removing pruned contexts.
Expand Down
2 changes: 1 addition & 1 deletion elfo-core/src/dumping/dump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl<'a> PartialEq<&'a str> for MessageName {
fn eq(&self, s: &&'a str) -> bool {
if let Some(variant) = self.1 {
s.split_once("::")
.map_or(false, |(n, v)| n == self.0 && v == variant)
.is_some_and(|(n, v)| n == self.0 && v == variant)
} else {
self.0 == *s
}
Expand Down
4 changes: 2 additions & 2 deletions elfo-macros-impl/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn is_type_ident(ident: &Ident) -> bool {
.to_string()
.chars()
.next()
.map_or(false, char::is_uppercase)
.is_some_and(char::is_uppercase)
}

fn extract_path_to_type(path: &Path) -> Path {
Expand Down Expand Up @@ -125,7 +125,7 @@ fn is_binding_with_type(ident: &PatIdent) -> bool {
ident
.subpat
.as_ref()
.map_or(false, |sp| is_likely_type(&sp.1))
.is_some_and(|sp| is_likely_type(&sp.1))
}

fn refine_pat(pat: &mut Pat) {
Expand Down
2 changes: 1 addition & 1 deletion elfo-network/src/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ impl SocketReader {
// If the recipient is unstable (i.e. already has pending messages), enqueue and
// return. The envelope will be handled by the corresponding pusher.
// Unexisted flows (new ones or already closed) are considered stable.
if flow.as_ref().map_or(false, |f| !f.is_stable()) {
if flow.as_ref().is_some_and(|f| !f.is_stable()) {
let mut flow = flow.unwrap();
flow.acquire_direct(!routed);
flow.enqueue(envelope, routed);
Expand Down

0 comments on commit 86c601a

Please sign in to comment.