fix clippy
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
diff --git a/src/channel.rs b/src/channel.rs
index 61c77ce..7f15d9b 100644
--- a/src/channel.rs
+++ b/src/channel.rs
@@ -182,7 +182,7 @@
/// Set whether to allow the use of `SO_REUSEPORT` if available. Defaults to `true`.
pub fn reuse_port(mut self, reuse: bool) -> ChannelBuilder {
- let opt = if reuse { 1 } else { 0 };
+ let opt = reuse as i32;
self.options.insert(
Cow::Borrowed(grpcio_sys::GRPC_ARG_ALLOW_REUSEPORT),
Options::Integer(opt),
@@ -588,7 +588,7 @@
// If try_to_connect is true, the channel will try to establish a connection, potentially
// changing the state.
fn check_connectivity_state(&self, try_to_connect: bool) -> ConnectivityState {
- let should_try = if try_to_connect { 1 } else { 0 };
+ let should_try = try_to_connect as i32;
unsafe { grpc_sys::grpc_channel_check_connectivity_state(self.channel, should_try) }
}
}
diff --git a/src/security/credentials.rs b/src/security/credentials.rs
index 78c54cd..0654355 100644
--- a/src/security/credentials.rs
+++ b/src/security/credentials.rs
@@ -102,7 +102,7 @@
panic!("fetcher user_data must be set up!");
}
let f: &mut dyn ServerCredentialsFetcher =
- (&mut *(user_data as *mut Box<dyn ServerCredentialsFetcher>)).as_mut();
+ (*(user_data as *mut Box<dyn ServerCredentialsFetcher>)).as_mut();
let result = f.fetch();
match result {
Ok(Some(builder)) => {
diff --git a/src/task/promise.rs b/src/task/promise.rs
index e9b3646..cc2d21a 100644
--- a/src/task/promise.rs
+++ b/src/task/promise.rs
@@ -9,7 +9,7 @@
use crate::metadata::UnownedMetadata;
/// Batch job type.
-#[derive(PartialEq, Debug)]
+#[derive(PartialEq, Eq, Debug)]
pub enum BatchType {
/// Finish without reading any message.
Finish,