Skip to content

Commit 4d58b39

Browse files
authored
chore: fix unnameable-types (#675)
1 parent b21b9f9 commit 4d58b39

File tree

9 files changed

+19
-16
lines changed

9 files changed

+19
-16
lines changed

crates/dyn-abi/src/dynamic/call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct DynSolCall {
2020

2121
impl DynSolCall {
2222
/// Create a new `DynSolCall` with the given selector and types.
23-
pub fn new(
23+
pub const fn new(
2424
selector: Selector,
2525
parameters: Vec<DynSolType>,
2626
method: Option<String>,
@@ -89,7 +89,7 @@ impl From<DynSolReturns> for Vec<DynSolType> {
8989

9090
impl DynSolReturns {
9191
/// Create a new `DynSolReturns` with the given types.
92-
pub fn new(types: Vec<DynSolType>) -> Self {
92+
pub const fn new(types: Vec<DynSolType>) -> Self {
9393
Self(types)
9494
}
9595

crates/json-abi/src/internal_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl InternalType {
203203
}
204204

205205
#[derive(Clone, Copy, Debug)]
206-
pub enum BorrowedInternalType<'a> {
206+
pub(crate) enum BorrowedInternalType<'a> {
207207
AddressPayable(&'a str),
208208
Contract(&'a str),
209209
Enum { contract: Option<&'a str>, ty: &'a str },

crates/sol-macro-input/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ extern crate syn_solidity as ast;
1818

1919
/// Tools for working with `#[...]` attributes.
2020
mod attr;
21-
pub use attr::{derives_mapped, docs_str, mk_doc, parse_derives, ContainsSolAttrs, SolAttrs};
21+
pub use attr::{
22+
derives_mapped, docs_str, mk_doc, parse_derives, CasingStyle, ContainsSolAttrs, SolAttrs,
23+
};
2224

2325
mod input;
2426
pub use input::{SolInput, SolInputKind};

crates/sol-types/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,9 @@ mod impl_core;
186186
mod types;
187187
pub use types::{
188188
data_type as sol_data, decode_revert_reason, ContractError, EventTopic, GenericContractError,
189-
GenericRevertReason, Panic, PanicKind, Revert, Selectors, SolCall, SolConstructor, SolEnum,
190-
SolError, SolEvent, SolEventInterface, SolInterface, SolStruct, SolType, SolValue, TopicList,
189+
GenericRevertReason, Panic, PanicKind, Revert, RevertReason, Selectors, SolCall,
190+
SolConstructor, SolEnum, SolError, SolEvent, SolEventInterface, SolInterface, SolStruct,
191+
SolType, SolValue, TopicList,
191192
};
192193

193194
pub mod utils;

crates/sol-types/src/types/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ pub use function::{SolCall, SolConstructor};
1414

1515
mod interface;
1616
pub use interface::{
17-
ContractError, GenericContractError, GenericRevertReason, Selectors, SolEventInterface,
18-
SolInterface,
17+
ContractError, GenericContractError, GenericRevertReason, RevertReason, Selectors,
18+
SolEventInterface, SolInterface,
1919
};
2020

2121
mod r#struct;

crates/syn-solidity/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub use visit_mut::VisitMut;
8181

8282
mod yul;
8383
pub use yul::{
84-
WalrusToken, YulBlock, YulCaseBranch, YulEVMBuiltIn, YulExpr, YulFnCall, YulFor,
84+
WalrusToken, YulBlock, YulCaseBranch, YulEVMBuiltIn, YulExpr, YulFnCall, YulFnType, YulFor,
8585
YulFunctionDef, YulIdent, YulIf, YulPath, YulReturns, YulStmt, YulSwitch, YulSwitchDefault,
8686
YulVarAssign, YulVarDecl,
8787
};

crates/syn-solidity/src/yul/expr/fn_call.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use syn::{
1515
/// <https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.yulFunctionCall>
1616
#[derive(Clone)]
1717
pub struct YulFnCall {
18-
pub function_type: FnType,
18+
pub function_type: YulFnType,
1919
pub paren_token: Paren,
2020
pub arguments: Punctuated<YulExpr, Token![,]>,
2121
}
@@ -55,15 +55,15 @@ impl fmt::Debug for YulFnCall {
5555

5656
/// What type of function is called.
5757
#[derive(Clone)]
58-
pub enum FnType {
58+
pub enum YulFnType {
5959
/// When calling a self defined function
6060
Custom(YulIdent),
6161

6262
/// When calling a built in evm opcode
6363
EVMOpcode(YulEVMBuiltIn),
6464
}
6565

66-
impl Parse for FnType {
66+
impl Parse for YulFnType {
6767
fn parse(input: ParseStream<'_>) -> Result<Self> {
6868
let speculative_parse = input.fork();
6969

@@ -76,7 +76,7 @@ impl Parse for FnType {
7676
}
7777
}
7878

79-
impl Spanned for FnType {
79+
impl Spanned for YulFnType {
8080
fn span(&self) -> Span {
8181
match self {
8282
Self::Custom(custom) => custom.span(),
@@ -92,7 +92,7 @@ impl Spanned for FnType {
9292
}
9393
}
9494

95-
impl fmt::Debug for FnType {
95+
impl fmt::Debug for YulFnType {
9696
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9797
f.write_str("FnType::")?;
9898
match self {

crates/syn-solidity/src/yul/expr/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use syn::{
77
};
88

99
mod fn_call;
10-
pub use fn_call::YulFnCall;
10+
pub use fn_call::{YulFnCall, YulFnType};
1111

1212
/// A Yul expression.
1313
///

crates/syn-solidity/src/yul/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mod expr;
2-
pub use expr::{YulExpr, YulFnCall};
2+
pub use expr::{YulExpr, YulFnCall, YulFnType};
33

44
mod stmt;
55
pub use stmt::{

0 commit comments

Comments
 (0)