chore: fix clippy lints (#707)
This commit is contained in:
@@ -19,7 +19,7 @@ pub(crate) mod proto {
|
||||
#![allow(unreachable_pub)]
|
||||
tonic::include_proto!("grpc.reflection.v1alpha");
|
||||
|
||||
pub(crate) const FILE_DESCRIPTOR_SET: &'static [u8] =
|
||||
pub(crate) const FILE_DESCRIPTOR_SET: &[u8] =
|
||||
tonic::include_file_descriptor_set!("reflection_v1alpha1");
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ impl<'b> Builder<'b> {
|
||||
field: &FieldDescriptorProto,
|
||||
) -> Result<(), Error> {
|
||||
let field_name = extract_name(prefix, "field", field.name.as_ref())?;
|
||||
self.symbols.insert(field_name, fd.clone());
|
||||
self.symbols.insert(field_name, fd);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
@@ -265,7 +265,7 @@ impl ReflectionServiceState {
|
||||
None => Err(Status::not_found(format!("symbol '{}' not found", symbol))),
|
||||
Some(fd) => {
|
||||
let mut encoded_fd = Vec::new();
|
||||
if let Err(_) = fd.clone().encode(&mut encoded_fd) {
|
||||
if fd.clone().encode(&mut encoded_fd).is_err() {
|
||||
return Err(Status::internal("encoding error"));
|
||||
};
|
||||
|
||||
@@ -283,7 +283,7 @@ impl ReflectionServiceState {
|
||||
None => Err(Status::not_found(format!("file '{}' not found", filename))),
|
||||
Some(fd) => {
|
||||
let mut encoded_fd = Vec::new();
|
||||
if let Err(_) = fd.clone().encode(&mut encoded_fd) {
|
||||
if fd.clone().encode(&mut encoded_fd).is_err() {
|
||||
return Err(Status::internal("encoding error"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user