diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fc77a8..4b074b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/fp-bindgen/src/generators/mod.rs b/fp-bindgen/src/generators/mod.rs index 7f7032f..857e026 100644 --- a/fp-bindgen/src/generators/mod.rs +++ b/fp-bindgen/src/generators/mod.rs @@ -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 } diff --git a/fp-bindgen/src/types/enums.rs b/fp-bindgen/src/types/enums.rs index d3dd602..467dce1 100644 --- a/fp-bindgen/src/types/enums.rs +++ b/fp-bindgen/src/types/enums.rs @@ -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; @@ -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); } } diff --git a/fp-bindgen/src/types/structs.rs b/fp-bindgen/src/types/structs.rs index 2837849..82f7b39 100644 --- a/fp-bindgen/src/types/structs.rs +++ b/fp-bindgen/src/types/structs.rs @@ -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); } }