Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed May 24, 2024
1 parent 808d860 commit 9a537fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,19 @@ impl Channel {
options.ares_options.ndomains = domains.len() as c_int;

// Likewise for lookups.
for c_lookup in &options.lookups {
if let Some(c_lookup) = &options.lookups {
options.ares_options.lookups = c_lookup.as_ptr().cast_mut()
}

// And the resolvconf_path.
#[cfg(cares1_15)]
for c_resolvconf_path in &options.resolvconf_path {
if let Some(c_resolvconf_path) = &options.resolvconf_path {
options.ares_options.resolvconf_path = c_resolvconf_path.as_ptr().cast_mut()
}

// And the hosts_path.
#[cfg(cares1_19)]
for c_hosts_path in &options.hosts_path {
if let Some(c_hosts_path) = &options.hosts_path {
options.ares_options.hosts_path = c_hosts_path.as_ptr().cast_mut()
}

Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@
//! - Create a `Channel`.
//!
//! - Make queries on the `Channel`. Queries all take callbacks, which will be called when the
//! query completes.
//! query completes.
//!
//! - Have `c-ares` tell you what file descriptors to listen on for read and / or write events.
//! You can do this either by providing a callback, which is called whenever the set of interesting
//! file descriptors changes, or by querying the `Channel` directly either with `get_sock()` or
//! with `fds()`.
//! You can do this either by providing a callback, which is called whenever the set of
//! interesting file descriptors changes, or by querying the `Channel` directly either with
//! `get_sock()` or with `fds()`.
//!
//! - Do as `c-ares` asks. That is, listen for the events that it requests, on the file
//! descriptors that it cares about.
//! descriptors that it cares about.
//!
//! - When a file descriptor becomes readable or writable, call either `process_fd()` or
//! `process()` on the `Channel` to tell `c-ares` what has happened.
//! `process()` on the `Channel` to tell `c-ares` what has happened.
//!
//! - If you have queries pending and don't see events happening, you still need to call either
//! `process_fd()` or `process()` at some point anyway - to give `c-ares` an opportunity to process
//! any requests that have timed out.
//! `process_fd()` or `process()` at some point anyway - to give `c-ares` an opportunity to
//! process any requests that have timed out.
//!
//! Complete examples showing how to use the library can be found
//! [here](https://github.com/dimbleby/rust-c-ares/tree/main/examples).
Expand Down

0 comments on commit 9a537fc

Please sign in to comment.