chore: fix clippy lints (#707)

This commit is contained in:
David Pedersen
2021-07-09 18:23:55 +02:00
committed by GitHub
parent 5aa8ae1fec
commit 4b0ece6d28
19 changed files with 47 additions and 41 deletions
+1 -1
View File
@@ -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");
}
+3 -3
View File
@@ -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"));
}