Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove needless deref & borrow #37

Merged
merged 3 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/assemble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
cargo fmt -- --check

- run: |
cargo clippy -- --no-deps -D warnings
make cargo-clippy

- run: |
cargo test
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ swagger-ui: ## docs :
./scripts/swagger-ui.sh

cargo-clippy: ## lint :
cargo clippy -- --no-deps -D warnings
cargo clippy -- \
--no-deps \
--allow clippy::derive_partial_eq_without_eq \
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason to accept this lint.
waiting for derive_partial_eq_without_eq to be removed from the default rule.

rf. rust-lang/rust-clippy#9063

--deny warnings

cargo-fmt: ## format :
cargo fmt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl RefResolver<'_> {
let is_nullable = self.is_nullable(shape)?;
let mut data_type = match shape {
TypeShape::Vec { type_shape, .. } => {
DataType::Vec(Box::new(self.type_shape_to_data_type(&*type_shape)?))
DataType::Vec(Box::new(self.type_shape_to_data_type(type_shape)?))
}
TypeShape::Ref { object, .. } => {
let type_name = match String::from(object.clone()) {
Expand Down
10 changes: 8 additions & 2 deletions scripts/test-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ set -xue

main () {
cd ./examples/v3.0
cargo fmt
cargo clippy -- --no-deps -D warnings

cargo fmt -- --check

cargo clippy -- \
--no-deps \
--allow clippy::derive_partial_eq_without_eq \
--deny warnings

cargo test
}

Expand Down