Refactor: moved internal compiler Import object to its oen file #39
development.yml
on: push
Matrix: Test / Build & Test
Matrix: Coverage / Coverage
Analyze
/
Check | Clippy
25s
Analyze
/
Check | Audit
9s
Analyze
/
Format Code
8s
Release
/
Create Pre Release
0s
Release
/
Create Release Pull Request
0s
Annotations
51 warnings
Test / Build & Test (macos-12)
A brownout will take place on November 4, 14:00 UTC - November 5, 00:00 UTC to raise awareness of the upcoming macOS-12 environment removal. For more details, see https://github.com/actions/runner-images/issues/10721
|
Coverage / Coverage (macos-12)
A brownout will take place on November 4, 14:00 UTC - November 5, 00:00 UTC to raise awareness of the upcoming macOS-12 environment removal. For more details, see https://github.com/actions/runner-images/issues/10721
|
this expression creates a reference which is immediately dereferenced by the compiler:
cli/src/builder.rs#L55
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> cli/src/builder.rs:55:66
|
55 | let (context, mut generator) = Generator::new(protocols, &output, generator);
| ^^^^^^^ help: change this to: `output`
|
= 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 expression creates a reference which is immediately dereferenced by the compiler:
compiler/src/api/tools/mod.rs#L67
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/api/tools/mod.rs:67:50
|
67 | Self::generate(&generator, &mut context, &config)?;
| ^^^^^^^ help: change this to: `config`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the following explicit lifetimes could be elided: 'a:
compiler/src/api/tools/mod.rs#L50
warning: the following explicit lifetimes could be elided: 'a
--> compiler/src/api/tools/mod.rs:50:17
|
50 | fn generate<'a, 'b>(
| ^^
51 | generator: &'b Generator<'a, Self::Solver, Self::Generator>,
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
50 ~ fn generate<'b>(
51 ~ generator: &'b Generator<'_, Self::Solver, Self::Generator>,
|
|
the following explicit lifetimes could be elided: 'a:
compiler/src/api/tools/rust.rs#L52
warning: the following explicit lifetimes could be elided: 'a
--> compiler/src/api/tools/rust.rs:52:17
|
52 | fn generate<'a, 'b>(
| ^^
53 | generator: &'b Generator<'a, Self::Solver, Self::Generator>,
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
52 ~ fn generate<'b>(
53 ~ generator: &'b Generator<'_, Self::Solver, Self::Generator>,
|
|
length comparison to zero:
compiler/src/api/core/loader.rs#L108
warning: length comparison to zero
--> compiler/src/api/core/loader.rs:108:31
|
108 | if iterations == 0 && self.models.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.models.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
the borrowed expression implements the required traits:
compiler/src/api/core/loader.rs#L59
warning: the borrowed expression implements the required traits
--> compiler/src/api/core/loader.rs:59:37
|
59 | self.load_from_file(&file.path(), package)?
| ^^^^^^^^^^^^ help: change this to: `file.path()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
this expression creates a reference which is immediately dereferenced by the compiler:
compiler/src/api/core/generator.rs#L186
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/api/core/generator.rs:186:78
|
186 | let umbrella = G::generate_umbrella(name, iter.iter().map(|v| &**v), &generator_params)
| ^^^^^^^^^^^^^^^^^ help: change this to: `generator_params`
|
= 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:
compiler/src/api/tools/mod.rs#L67
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/api/tools/mod.rs:67:50
|
67 | Self::generate(&generator, &mut context, &config)?;
| ^^^^^^^ help: change this to: `config`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
compiler/src/api/core/generator.rs#L157
warning: the borrowed expression implements the required traits
--> compiler/src/api/core/generator.rs:157:48
|
157 | let out_path = self.out_directory.join(&name);
| ^^^^^ help: change this to: `name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
the following explicit lifetimes could be elided: 'a:
compiler/src/api/tools/mod.rs#L50
warning: the following explicit lifetimes could be elided: 'a
--> compiler/src/api/tools/mod.rs:50:17
|
50 | fn generate<'a, 'b>(
| ^^
51 | generator: &'b Generator<'a, Self::Solver, Self::Generator>,
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
help: elide the lifetimes
|
50 ~ fn generate<'b>(
51 ~ generator: &'b Generator<'_, Self::Solver, Self::Generator>,
|
|
this expression creates a reference which is immediately dereferenced by the compiler:
compiler/src/api/core/generator.rs#L156
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/api/core/generator.rs:156:43
|
156 | let files = G::generate(protocol, &generator_params).map_err(|e| Error::Generator(e.to_string()))?;
| ^^^^^^^^^^^^^^^^^ help: change this to: `generator_params`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the following explicit lifetimes could be elided: 'a:
compiler/src/api/tools/rust.rs#L52
warning: the following explicit lifetimes could be elided: 'a
--> compiler/src/api/tools/rust.rs:52:17
|
52 | fn generate<'a, 'b>(
| ^^
53 | generator: &'b Generator<'a, Self::Solver, Self::Generator>,
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `#[warn(clippy::needless_lifetimes)]` on by default
help: elide the lifetimes
|
52 ~ fn generate<'b>(
53 ~ generator: &'b Generator<'_, Self::Solver, Self::Generator>,
|
|
length comparison to zero:
compiler/src/api/core/loader.rs#L108
warning: length comparison to zero
--> compiler/src/api/core/loader.rs:108:31
|
108 | if iterations == 0 && self.models.len() > 0 {
| ^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.models.is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
|
the borrowed expression implements the required traits:
compiler/src/api/core/loader.rs#L59
warning: the borrowed expression implements the required traits
--> compiler/src/api/core/loader.rs:59:37
|
59 | self.load_from_file(&file.path(), package)?
| ^^^^^^^^^^^^ help: change this to: `file.path()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
|
this expression creates a reference which is immediately dereferenced by the compiler:
compiler/src/api/core/generator.rs#L186
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/api/core/generator.rs:186:78
|
186 | let umbrella = G::generate_umbrella(name, iter.iter().map(|v| &**v), &generator_params)
| ^^^^^^^^^^^^^^^^^ help: change this to: `generator_params`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
|
the borrowed expression implements the required traits:
compiler/src/api/core/generator.rs#L157
warning: the borrowed expression implements the required traits
--> compiler/src/api/core/generator.rs:157:48
|
157 | let out_path = self.out_directory.join(&name);
| ^^^^^ help: change this to: `name`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
= note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
|
this expression creates a reference which is immediately dereferenced by the compiler:
compiler/src/api/core/generator.rs#L156
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/api/core/generator.rs:156:43
|
156 | let files = G::generate(protocol, &generator_params).map_err(|e| Error::Generator(e.to_string()))?;
| ^^^^^^^^^^^^^^^^^ help: change this to: `generator_params`
|
= 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:
compiler/src/gen/swift/mod.rs#L76
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:76:70
|
76 | let decl_unions = proto.unions.iter().map(|v| gen_union_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L75
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:75:93
|
75 | let impl_write_messages_code = proto.messages.iter().map(|v| gen_message_write_impl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L74
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:74:103
|
74 | let impl_from_slice_messages_code = proto.messages.iter().map(|v| gen_message_from_slice_impl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L73
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:73:81
|
73 | let decl_messages_code = proto.messages.iter().map(|v| gen_message_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L72
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:72:67
|
72 | let decl_enums = proto.enums.iter().map(|v| gen_enum_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L71
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:71:79
|
71 | let decl_structures = proto.structs.iter().map(|v| gen_structure_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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
|
methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference:
compiler/src/gen/rust/util.rs#L94
warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
--> compiler/src/gen/rust/util.rs:94:36
|
94 | pub fn to_string_with_defaults(self) -> Cow<'a, str> {
| ^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
|
methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference:
compiler/src/gen/rust/util.rs#L74
warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
--> compiler/src/gen/rust/util.rs:74:22
|
74 | pub fn to_string(self) -> Cow<'a, str> {
| ^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
|
this lifetime isn't used in the impl:
compiler/src/gen/rust/solver.rs#L34
warning: this lifetime isn't used in the impl
--> compiler/src/gen/rust/solver.rs:34:6
|
34 | impl<'a> ImportSolver for RustImportSolver {
| ^^
|
= 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
|
this expression creates a reference which is immediately dereferenced by the compiler:
compiler/src/gen/swift/mod.rs#L76
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:76:70
|
76 | let decl_unions = proto.unions.iter().map(|v| gen_union_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L75
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:75:93
|
75 | let impl_write_messages_code = proto.messages.iter().map(|v| gen_message_write_impl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L74
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:74:103
|
74 | let impl_from_slice_messages_code = proto.messages.iter().map(|v| gen_message_from_slice_impl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L73
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:73:81
|
73 | let decl_messages_code = proto.messages.iter().map(|v| gen_message_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L72
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:72:67
|
72 | let decl_enums = proto.enums.iter().map(|v| gen_enum_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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:
compiler/src/gen/swift/mod.rs#L71
warning: this expression creates a reference which is immediately dereferenced by the compiler
--> compiler/src/gen/swift/mod.rs:71:79
|
71 | let decl_structures = proto.structs.iter().map(|v| gen_structure_decl(&proto, v));
| ^^^^^^ help: change this to: `proto`
|
= 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 `impl` can be derived:
compiler/src/gen/template/options.rs#L37
warning: this `impl` can be derived
--> compiler/src/gen/template/options.rs:37:1
|
37 | / impl<'a> Default for Options<'a> {
38 | | fn default() -> Self {
39 | | Self {
40 | | function_map: FunctionMap::default(),
... |
43 | | }
44 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
32 + #[derive(Default)]
33 | pub struct Options<'a> {
|
|
methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference:
compiler/src/gen/rust/util.rs#L94
warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
--> compiler/src/gen/rust/util.rs:94:36
|
94 | pub fn to_string_with_defaults(self) -> Cow<'a, str> {
| ^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
|
methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference:
compiler/src/gen/rust/util.rs#L74
warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference
--> compiler/src/gen/rust/util.rs:74:22
|
74 | pub fn to_string(self) -> Cow<'a, str> {
| ^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
|
use of `or_insert` to construct default value:
compiler/src/gen/hook.rs#L102
warning: use of `or_insert` to construct default value
--> compiler/src/gen/hook.rs:102:42
|
102 | let entry = self.map.entry(name).or_insert(Vec::new());
| ^^^^^^^^^^^^^^^^^^^^^ 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
|
this lifetime isn't used in the impl:
compiler/src/gen/rust/solver.rs#L34
warning: this lifetime isn't used in the impl
--> compiler/src/gen/rust/solver.rs:34:6
|
34 | impl<'a> ImportSolver for RustImportSolver {
| ^^
|
= 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
|
this `impl` can be derived:
compiler/src/gen/template/options.rs#L37
warning: this `impl` can be derived
--> compiler/src/gen/template/options.rs:37:1
|
37 | / impl<'a> Default for Options<'a> {
38 | | fn default() -> Self {
39 | | Self {
40 | | function_map: FunctionMap::default(),
... |
43 | | }
44 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
32 + #[derive(Default)]
33 | pub struct Options<'a> {
|
|
use of `or_insert` to construct default value:
compiler/src/gen/hook.rs#L102
warning: use of `or_insert` to construct default value
--> compiler/src/gen/hook.rs:102:42
|
102 | let entry = self.map.entry(name).or_insert(Vec::new());
| ^^^^^^^^^^^^^^^^^^^^^ 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
|
you should consider adding a `Default` implementation for `ObjectStore<T>`:
compiler/src/compiler/util/store.rs#L41
warning: you should consider adding a `Default` implementation for `ObjectStore<T>`
--> compiler/src/compiler/util/store.rs:41:5
|
41 | / pub fn new() -> Self {
42 | | Self {
43 | | objects: Vec::new(),
44 | | objects_by_name: IndexMap::new(),
45 | | objects_imports: HashMap::new(),
46 | | }
47 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
40 + impl<T: bp3d_util::index_map::Index<Key = str>> Default for ObjectStore<T> {
41 + fn default() -> Self {
42 + Self::new()
43 + }
44 + }
|
|
you should consider adding a `Default` implementation for `ObjectStore<T>`:
compiler/src/compiler/util/store.rs#L41
warning: you should consider adding a `Default` implementation for `ObjectStore<T>`
--> compiler/src/compiler/util/store.rs:41:5
|
41 | / pub fn new() -> Self {
42 | | Self {
43 | | objects: Vec::new(),
44 | | objects_by_name: IndexMap::new(),
45 | | objects_imports: HashMap::new(),
46 | | }
47 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
40 + impl<T: bp3d_util::index_map::Index<Key = str>> Default for ObjectStore<T> {
41 + fn default() -> Self {
42 + Self::new()
43 + }
44 + }
|
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L184
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:184:66
|
184 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_message()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| proto.types.get(v))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L184
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:184:104
|
184 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_message()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| v.as_message())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L173
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:173:66
|
173 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_struct()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| proto.types.get(v))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L173
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:173:104
|
173 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_struct()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| v.as_struct())`
|
= 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
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L184
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:184:66
|
184 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_message()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| proto.types.get(v))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L184
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:184:104
|
184 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_message()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| v.as_message())`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L173
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:173:66
|
173 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_struct()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| proto.types.get(v))`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
|
called `map(..).flatten()` on `Option`:
compiler/src/compiler/protocol.rs#L173
warning: called `map(..).flatten()` on `Option`
--> compiler/src/compiler/protocol.rs:173:104
|
173 | if let Some(info) = field.item_type.as_ref().map(|v| proto.types.get(v)).flatten().map(|v| v.as_struct()).flatten() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| v.as_struct())`
|
= 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
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
coverage-macos-12
|
305 KB |
|
coverage-ubuntu-20.04
|
305 KB |
|
coverage-windows-2019
|
302 KB |
|