Skip to content

Commit

Permalink
Fix clippies 2024-05-03 (#207)
Browse files Browse the repository at this point in the history
* cargo clippy --fix

* Fix formatting

* Pin version to 1.77

* Add components
  • Loading branch information
hatchan authored May 3, 2024
1 parent 19575e3 commit 7e60cbf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
File renamed without changes.
9 changes: 3 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install latest stable compiler
id: toolchain
uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
override: true
components: clippy
toolchain: "1.77"
components: clippy, rustfmt

- name: Cache multiple paths
id: cache
Expand Down
2 changes: 1 addition & 1 deletion fp-bindgen/src/generators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ impl TsRuntimeConfig {

/// Sets the `msgpack_module` setting.
pub fn with_msgpack_module(mut self, msgpack_module: &str) -> Self {
self.msgpack_module = msgpack_module.to_owned();
msgpack_module.clone_into(&mut self.msgpack_module);
self
}

Expand Down
6 changes: 3 additions & 3 deletions fp-bindgen/src/types/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ impl EnumOptions {
self.variant_casing = other.variant_casing;
}
if other.content_prop_name.is_some() {
self.content_prop_name = other.content_prop_name.clone();
self.content_prop_name.clone_from(&other.content_prop_name);
}
if other.tag_prop_name.is_some() {
self.tag_prop_name = other.tag_prop_name.clone();
self.tag_prop_name.clone_from(&other.tag_prop_name);
}
if other.untagged {
self.untagged = true;
Expand Down Expand Up @@ -306,7 +306,7 @@ impl VariantAttrs {
self.field_casing = other.field_casing;
}
if other.rename.is_some() {
self.rename = other.rename.clone();
self.rename.clone_from(&other.rename);
}
}

Expand Down
11 changes: 6 additions & 5 deletions fp-bindgen/src/types/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,22 +220,23 @@ impl FieldAttrs {

fn merge_with(&mut self, other: &Self) {
if other.default.is_some() {
self.default = other.default.clone();
self.default.clone_from(&other.default);
}
if other.deserialize_with.is_some() {
self.deserialize_with = other.deserialize_with.clone();
self.deserialize_with.clone_from(&other.deserialize_with);
}
if other.flatten {
self.flatten = other.flatten;
}
if other.rename.is_some() {
self.rename = other.rename.clone();
self.rename.clone_from(&other.rename);
}
if other.serialize_with.is_some() {
self.serialize_with = other.serialize_with.clone();
self.serialize_with.clone_from(&other.serialize_with);
}
if other.skip_serializing_if.is_some() {
self.skip_serializing_if = other.skip_serializing_if.clone();
self.skip_serializing_if
.clone_from(&other.skip_serializing_if);
}
}

Expand Down

0 comments on commit 7e60cbf

Please sign in to comment.