Skip to content

Commit

Permalink
Suppress "unused unit" warnings from Clippy in the generated code
Browse files Browse the repository at this point in the history
These warnings are new in the latest nightly 1.46.0.

Fixes #142
  • Loading branch information
asomers committed Jun 10, 2020
1 parent 7c23b5c commit f03f591
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
was omitted as an oversight from PR #47.
([#141](https://github.com/asomers/mockall/pull/141))

- Suppressed `unused unit` warnings from Clippy in the latest nightly.
([#148](https://github.com/asomers/mockall/pull/148))

### Removed

## [0.7.1] - 3 May 2020
Expand Down
2 changes: 2 additions & 0 deletions mockall_derive/src/automock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ fn mock_foreign(attrs: Attrs, foreign_mod: ItemForeignMod) -> TokenStream {
pub fn checkpoint() { #cp_body }).to_tokens(&mut body);
quote!(
#[allow(missing_docs)]
#[allow(clippy::unused_unit)]
pub mod #modname {
use super::*;
#body
Expand Down Expand Up @@ -639,6 +640,7 @@ fn mock_module(mod_: ItemMod) -> TokenStream {
};
quote!(
#docstr
#[allow(clippy::unused_unit)]
pub mod #modname { #body })
}

Expand Down
1 change: 1 addition & 0 deletions mockall_derive/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ fn gen_struct<T>(attrs: &[syn::Attribute],
let (ig, tg, wc) = generics.split_for_impl();
quote!(
#[allow(non_snake_case)]
#[allow(clippy::unused_unit)]
#[doc(hidden)]
pub mod #mod_ident {
use super::*;
Expand Down

0 comments on commit f03f591

Please sign in to comment.