feat: use afit to optimize codec (#203) #551
ci.yaml
on: push
Matrix: lint
test-linux
45s
test-linux-aarch64
1m 30s
test-macos
4m 28s
test-windows
5m 47s
CI is green
0s
Annotations
53 warnings
this function has too many arguments (8/7):
pilota-build/src/lib.rs#L232
warning: this function has too many arguments (8/7)
--> pilota-build/src/lib.rs:232:5
|
232 | / pub fn build_cx(
233 | | services: Vec<IdlService>,
234 | | out: Option<Output>,
235 | | mut parser: P,
... |
240 | | keep_unknown_fields: Vec<PathBuf>,
241 | | ) -> Context {
| |________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
pilota-build/src/plugin/mod.rs#L129
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> pilota-build/src/plugin/mod.rs:129:13
|
129 | / match &node.kind {
130 | | NodeKind::Item(item) => p.on_item(cx, *def_id, item.clone()),
131 | | _ => {}
132 | | }
| |_____________^ help: try: `if let NodeKind::Item(item) = &node.kind { p.on_item(cx, *def_id, item.clone()) }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
pilota-build/src/plugin/workspace.rs#L34
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> pilota-build/src/plugin/workspace.rs:34:9
|
34 | / match &*item {
35 | | Item::Service(s) => {
36 | | if let Some(loc) = cx.location_map.get(&def_id) {
37 | | if let Some(mut gen) = cx.plugin_gen.get_mut(loc) {
... |
42 | | _ => {}
43 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
help: try
|
34 ~ if let Item::Service(s) = &*item {
35 + if let Some(loc) = cx.location_map.get(&def_id) {
36 + if let Some(mut gen) = cx.plugin_gen.get_mut(loc) {
37 + gen.push_str(&format!("pub struct {};", s.name.sym));
38 + }
39 + };
40 + }
|
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
pilota-build/src/plugin/workspace.rs#L19
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> pilota-build/src/plugin/workspace.rs:19:21
|
19 | / match &node.kind {
20 | | NodeKind::Item(item) => self.on_item(cx, *def_id, item.clone()),
21 | | _ => {}
22 | | }
| |_____________________^ help: try: `if let NodeKind::Item(item) = &node.kind { self.on_item(cx, *def_id, item.clone()) }`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
|
accessing first element with `status.r#mod.get(0)`:
pilota-build/src/resolve.rs#L458
warning: accessing first element with `status.r#mod.get(0)`
--> pilota-build/src/resolve.rs:458:31
|
458 | Namespace::Mod => status.r#mod.get(0),
| ^^^^^^^^^^^^^^^^^^^ help: try: `status.r#mod.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
accessing first element with `status.ty.get(0)`:
pilota-build/src/resolve.rs#L457
warning: accessing first element with `status.ty.get(0)`
--> pilota-build/src/resolve.rs:457:30
|
457 | Namespace::Ty => status.ty.get(0),
| ^^^^^^^^^^^^^^^^ help: try: `status.ty.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
|
accessing first element with `status.value.get(0)`:
pilota-build/src/resolve.rs#L456
warning: accessing first element with `status.value.get(0)`
--> pilota-build/src/resolve.rs:456:33
|
456 | Namespace::Value => status.value.get(0),
| ^^^^^^^^^^^^^^^^^^^ help: try: `status.value.first()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first
= note: `#[warn(clippy::get_first)]` on by default
|
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`:
pilota-build/src/resolve.rs#L167
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> pilota-build/src/resolve.rs:167:13
|
167 | / match &item.kind {
168 | | ir::ItemKind::Enum(e) => e.variants.iter().for_each(|e| {
169 | | self.def_sym(Namespace::Value, (*e.name).clone());
170 | | }),
171 | | _ => {}
172 | | }
| |_____________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
167 ~ if let ir::ItemKind::Enum(e) = &item.kind { e.variants.iter().for_each(|e| {
168 + self.def_sym(Namespace::Value, (*e.name).clone());
169 + }) }
|
|
parameter is only used in recursion:
pilota-build/src/parser/protobuf/mod.rs#L66
warning: parameter is only used in recursion
--> pilota-build/src/parser/protobuf/mod.rs:66:9
|
66 | message_name: Option<&str>,
| ^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_message_name`
|
note: parameter used here
--> pilota-build/src/parser/protobuf/mod.rs:81:33
|
81 | ... message_name,
| ^^^^^^^^^^^^
...
87 | ... message_name,
| ^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion
= note: `#[warn(clippy::only_used_in_recursion)]` on by default
|
single-character string constant used as pattern:
pilota-build/src/middle/context.rs#L916
warning: single-character string constant used as pattern
--> pilota-build/src/middle/context.rs:916:38
|
916 | ... .replace(".", "_")
| ^^^ help: try using a `char` instead: `'.'`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern
= note: `#[warn(clippy::single_char_pattern)]` on by default
|
redundant closure:
pilota-build/src/middle/context.rs#L907
warning: redundant closure
--> pilota-build/src/middle/context.rs:907:45
|
907 | .map(|s| s.as_str().map(|s| FastStr::new(s)))
| ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `FastStr::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
|
called `map(..).flatten()` on `Option`:
pilota-build/src/middle/context.rs#L907
warning: called `map(..).flatten()` on `Option`
--> pilota-build/src/middle/context.rs:907:22
|
907 | .map(|s| s.as_str().map(|s| FastStr::new(s)))
| ______________________^
908 | | .flatten()
| |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| s.as_str().map(|s| FastStr::new(s)))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
|
use of `or_insert_with` to construct default value:
pilota-build/src/middle/context.rs#L442
warning: use of `or_insert_with` to construct default value
--> pilota-build/src/middle/context.rs:442:55
|
442 | let adjust = &mut *self.adjusts.entry(def_id).or_insert_with(Default::default);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `#[warn(clippy::unwrap_or_default)]` on by default
|
if let .. else expression looks like `matches!` macro:
pilota-build/src/middle/context.rs#L369
warning: if let .. else expression looks like `matches!` macro
--> pilota-build/src/middle/context.rs:369:33
|
369 | / ... if let Some(crate::tags::KeepUnknownFields(false)) =
370 | | ... cx.db.tags_map().get(&tags).and_then(|tags| {
371 | | ... tags.get::<crate::tags::KeepUnknownFields>()
372 | | ... })
... |
376 | | ... true
377 | | ... }
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro
= note: `#[warn(clippy::match_like_matches_macro)]` on by default
help: try
|
369 ~ !matches!(cx.db.tags_map().get(&tags).and_then(|tags| {
370 + tags.get::<crate::tags::KeepUnknownFields>()
371 + }), Some(crate::tags::KeepUnknownFields(false)))
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
pilota-build/src/middle/context.rs#L358
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> pilota-build/src/middle/context.rs:358:38
|
358 | let file = files.get(&file_id).unwrap();
| ^^^^^^^^ help: change this to: `file_id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
this expression creates a reference which is immediately dereferenced by the compiler:
pilota-build/src/middle/context.rs#L224
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> pilota-build/src/middle/context.rs:224:62
|
224 | PathCollector { cx, set }.visit_path(&p);
| ^^ help: change this to: `p`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
this lifetime isn't used in the function definition:
pilota-build/src/codegen/mod.rs#L427
warning: this lifetime isn't used in the function definition
--> pilota-build/src/codegen/mod.rs:427:24
|
427 | pub fn write_items<'a>(&self, stream: &mut String, items: impl Iterator<Item = CodegenItem>)
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes
= note: `#[warn(clippy::extra_unused_lifetimes)]` on by default
|
useless use of `format!`:
pilota-build/src/codegen/thrift/mod.rs#L679
warning: useless use of `format!`
--> pilota-build/src/codegen/thrift/mod.rs:679:33
|
679 | / ... format!(
680 | | ... r#"Err(::pilota::thrift::DecodeError::new(
681 | | ... ::pilota::thrift::DecodeErrorKind::InvalidData,
682 | | ... "received empty union from remote Message")
683 | | ... )"#
684 | | ... )
| |_______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
= note: `#[warn(clippy::useless_format)]` on by default
help: consider using `.to_string()`
|
679 ~ r#"Err(::pilota::thrift::DecodeError::new(
680 + ::pilota::thrift::DecodeErrorKind::InvalidData,
681 + "received empty union from remote Message")
682 + )"#.to_string()
|
|
writing `&mut String` instead of `&mut str` involves a new object where a slice will do:
pilota-build/src/codegen/thrift/mod.rs#L315
warning: writing `&mut String` instead of `&mut str` involves a new object where a slice will do
--> pilota-build/src/codegen/thrift/mod.rs:315:59
|
315 | fn codegen_entry_enum(&self, _def_id: DefId, _stream: &mut String, _e: &rir::Enum) {
| ^^^^^^^^^^^ help: change this to: `&mut str`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
= note: `#[warn(clippy::ptr_arg)]` on by default
|
redundant closure:
pilota-build/src/codegen/workspace.rs#L121
warning: redundant closure
--> pilota-build/src/codegen/workspace.rs:121:18
|
121 | .map(|s| FastStr::new(s))
| ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `FastStr::new`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure
= note: `#[warn(clippy::redundant_closure)]` on by default
|
use Vec::sort_by_key here instead:
pilota-build/src/codegen/toml.rs#L9
warning: use Vec::sort_by_key here instead
--> pilota-build/src/codegen/toml.rs:9:13
|
9 | a.sort_by(|a, b| a.to_string().cmp(&b.to_string()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.sort_by_key(|a| a.to_string())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
= note: `#[warn(clippy::unnecessary_sort_by)]` on by default
|
explicit call to `.into_iter()` in function argument accepting `IntoIterator`:
pilota-build/src/codegen/pkg_tree.rs#L32
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> pilota-build/src/codegen/pkg_tree.rs:32:20
|
32 | .chain(Some(k).into_iter())
| ^^^^^^^^^^^^^^^^^^^ help: consider removing the `.into_iter()`: `Some(k)`
|
note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()`
--> /rustc/1c05d50c8403c56d9a8b6fb871f15aaa26fb5d07/library/core/src/iter/traits/iterator.rs:523:12
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `#[warn(clippy::useless_conversion)]` on by default
|
unneeded `return` statement:
pilota/src/thrift/compact.rs#L1648
warning: unneeded `return` statement
--> pilota/src/thrift/compact.rs:1648:18
|
1648 | unsafe { return Ok(FastStr::from_bytes_unchecked(bytes)) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
1648 | unsafe { Ok(FastStr::from_bytes_unchecked(bytes)) }
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
question mark operator is useless here:
pilota/src/thrift/compact.rs#L1123
warning: question mark operator is useless here
--> pilota/src/thrift/compact.rs:1123:9
|
1123 | Ok(self.read_varint_async::<i64>().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.read_varint_async::<i64>().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
pilota/src/thrift/compact.rs#L1118
warning: question mark operator is useless here
--> pilota/src/thrift/compact.rs:1118:9
|
1118 | Ok(self.read_varint_async::<i32>().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.read_varint_async::<i32>().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
|
question mark operator is useless here:
pilota/src/thrift/compact.rs#L1113
warning: question mark operator is useless here
--> pilota/src/thrift/compact.rs:1113:9
|
1113 | Ok(self.read_varint_async::<i16>().await?)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `self.read_varint_async::<i16>().await`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
= note: `#[warn(clippy::needless_question_mark)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
pilota/src/thrift/binary_unsafe.rs#L1169
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> pilota/src/thrift/binary_unsafe.rs:1169:9
|
1169 | &mut self.trans
| ^^^^^^^^^^^^^^^ help: change this to: `self.trans`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `#[warn(clippy::needless_borrow)]` on by default
|
unneeded `return` statement:
pilota/src/thrift/binary_unsafe.rs#L1107
warning: unneeded `return` statement
--> pilota/src/thrift/binary_unsafe.rs:1107:13
|
1107 | return Ok(FastStr::from_bytes_unchecked(bytes));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
1107 - return Ok(FastStr::from_bytes_unchecked(bytes));
1107 + Ok(FastStr::from_bytes_unchecked(bytes))
|
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L738
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:738:17
|
738 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L683
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:683:17
|
683 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L674
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:674:21
|
674 | self.trans.bytes_mut().as_mut_ptr().offset(l as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.trans.bytes_mut().as_mut_ptr().add(l)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L653
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:653:17
|
653 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L551
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:551:17
|
551 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L542
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:542:21
|
542 | self.trans.bytes_mut().as_mut_ptr().offset(l as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.trans.bytes_mut().as_mut_ptr().add(l)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L448
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:448:17
|
448 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L393
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:393:17
|
393 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L379
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:379:17
|
379 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
|
use of `offset` with a `usize` casted to an `isize`:
pilota/src/thrift/binary_unsafe.rs#L277
warning: use of `offset` with a `usize` casted to an `isize`
--> pilota/src/thrift/binary_unsafe.rs:277:17
|
277 | self.buf.as_mut_ptr().offset(self.index as isize),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.buf.as_mut_ptr().add(self.index)`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_offset_with_cast
= note: `#[warn(clippy::ptr_offset_with_cast)]` on by default
|
unneeded `return` statement:
pilota/src/thrift/binary_le.rs#L912
warning: unneeded `return` statement
--> pilota/src/thrift/binary_le.rs:912:18
|
912 | unsafe { return Ok(FastStr::from_bytes_unchecked(bytes)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
912 - unsafe { return Ok(FastStr::from_bytes_unchecked(bytes)) };
912 + unsafe { Ok(FastStr::from_bytes_unchecked(bytes)) }
|
|
unneeded `return` statement:
pilota/src/thrift/binary.rs#L699
warning: unneeded `return` statement
--> pilota/src/thrift/binary.rs:699:18
|
699 | unsafe { return Ok(FastStr::from_bytes_unchecked(bytes)) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
699 - unsafe { return Ok(FastStr::from_bytes_unchecked(bytes)) };
699 + unsafe { Ok(FastStr::from_bytes_unchecked(bytes)) }
|
|
this function has too many arguments (8/7):
pilota/src/prost/encoding.rs#L1562
warning: this function has too many arguments (8/7)
--> pilota/src/prost/encoding.rs:1562:9
|
1562 | / pub fn encode_with_default<K, V, B, KE, KL, VE, VL>(
1563 | | key_encode: KE,
1564 | | key_encoded_len: KL,
1565 | | val_encode: VE,
... |
1570 | | buf: &mut B,
1571 | | ) where
| |_________^
...
1680 | map!(BTreeMap);
| -------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this function has too many arguments (8/7):
pilota/src/prost/encoding.rs#L1562
warning: this function has too many arguments (8/7)
--> pilota/src/prost/encoding.rs:1562:9
|
1562 | / pub fn encode_with_default<K, V, B, KE, KL, VE, VL>(
1563 | | key_encode: KE,
1564 | | key_encoded_len: KL,
1565 | | val_encode: VE,
... |
1570 | | buf: &mut B,
1571 | | ) where
| |_________^
...
1676 | map!(HashMap);
| ------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments
= note: `#[warn(clippy::too_many_arguments)]` on by default
= note: this warning originates in the macro `map` (in Nightly builds, run with -Z macro-backtrace for more info)
|
this `else { if .. }` block can be collapsed:
pilota-build/src/codegen/thrift/decode_helper.rs#L98
warning: this `else { if .. }` block can be collapsed
--> pilota-build/src/codegen/thrift/decode_helper.rs:98:16
|
98 | } else {
| ________________^
99 | | if keep {
100 | | "__pilota_offset += protocol.field_begin_len(field_ident.field_type, field_ident.id);".into()
101 | | } else {
102 | | "protocol.field_begin_len(field_ident.field_type, field_ident.id);".into()
103 | | }
104 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `#[warn(clippy::collapsible_else_if)]` on by default
help: collapse nested if block
|
98 ~ } else if keep {
99 + "__pilota_offset += protocol.field_begin_len(field_ident.field_type, field_ident.id);".into()
100 + } else {
101 + "protocol.field_begin_len(field_ident.field_type, field_ident.id);".into()
102 + }
|
|
the `pair @ _` pattern can be written as just `pair`:
pilota-build/src/codegen/toml.rs#L19
warning: the `pair @ _` pattern can be written as just `pair`
--> pilota-build/src/codegen/toml.rs:19:9
|
19 | pair @ _ => panic!("can not merge {pair:?}"),
| ^^^^^^^^ help: try: `pair`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern
= note: `#[warn(clippy::redundant_pattern)]` on by default
|
lint (nightly)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
test-macos
The following actions uses node12 which is deprecated and will be forced to run on node16: Swatinem/rust-cache@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
test-macos
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test-macos
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test-macos
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test-windows
The following actions uses node12 which is deprecated and will be forced to run on node16: Swatinem/rust-cache@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
test-windows
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test-windows
The `save-state` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
test-windows
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|