solc-json-interface: make the input Cloneable (#323)

It helps external consumers working with the
`revive-solc-json-interface` crate.

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus
2025-05-21 10:03:32 +02:00
committed by GitHub
parent af39d506d9
commit 3389865af7
8 changed files with 8 additions and 8 deletions
@@ -25,7 +25,7 @@ use self::settings::Settings;
use self::source::Source; use self::source::Source;
/// The `solc --standard-json` input. /// The `solc --standard-json` input.
#[derive(Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Input { pub struct Input {
/// The input language. /// The input language.
@@ -6,7 +6,7 @@ use serde::Serialize;
use crate::standard_json::input::settings::metadata_hash::MetadataHash; use crate::standard_json::input::settings::metadata_hash::MetadataHash;
/// The `solc --standard-json` input settings metadata. /// The `solc --standard-json` input settings metadata.
#[derive(Debug, Default, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Metadata { pub struct Metadata {
/// The bytecode hash mode. /// The bytecode hash mode.
@@ -18,7 +18,7 @@ use self::polkavm::PolkaVM;
use self::selection::Selection; use self::selection::Selection;
/// The `solc --standard-json` input settings. /// The `solc --standard-json` input settings.
#[derive(Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Settings { pub struct Settings {
/// The target EVM version. /// The target EVM version.
@@ -4,7 +4,7 @@ use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
/// The `solc --standard-json` input settings optimizer details. /// The `solc --standard-json` input settings optimizer details.
#[derive(Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Details { pub struct Details {
/// Whether the pass is enabled. /// Whether the pass is enabled.
@@ -8,7 +8,7 @@ use serde::Serialize;
use self::details::Details; use self::details::Details;
/// The `solc --standard-json` input settings optimizer. /// The `solc --standard-json` input settings optimizer.
#[derive(Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Optimizer { pub struct Optimizer {
/// Whether the optimizer is enabled. /// Whether the optimizer is enabled.
@@ -10,7 +10,7 @@ use serde::Serialize;
use self::flag::Flag as SelectionFlag; use self::flag::Flag as SelectionFlag;
/// The `solc --standard-json` output file selection. /// The `solc --standard-json` output file selection.
#[derive(Debug, Default, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Default, Serialize, Deserialize, PartialEq)]
pub struct File { pub struct File {
/// The per-file output selections. /// The per-file output selections.
#[serde(rename = "", skip_serializing_if = "Option::is_none")] #[serde(rename = "", skip_serializing_if = "Option::is_none")]
@@ -10,7 +10,7 @@ use serde::Serialize;
use self::file::File as FileSelection; use self::file::File as FileSelection;
/// The `solc --standard-json` output selection. /// The `solc --standard-json` output selection.
#[derive(Debug, Serialize, Deserialize, Default, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, Default, PartialEq)]
pub struct Selection { pub struct Selection {
/// Only the 'all' wildcard is available for robustness reasons. /// Only the 'all' wildcard is available for robustness reasons.
#[serde(rename = "*", skip_serializing_if = "Option::is_none")] #[serde(rename = "*", skip_serializing_if = "Option::is_none")]
@@ -7,7 +7,7 @@ use serde::Deserialize;
use serde::Serialize; use serde::Serialize;
/// The `solc --standard-json` input source. /// The `solc --standard-json` input source.
#[derive(Debug, Serialize, Deserialize)] #[derive(Clone, Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]
pub struct Source { pub struct Source {
/// The source code file content. /// The source code file content.