Skip to content

Commit

Permalink
chore(clippy): make clippy happy (#2618)
Browse files Browse the repository at this point in the history
* chore(clippy): make clippy happy

* raw strings
  • Loading branch information
mattsse committed Sep 28, 2023
1 parent eb29df1 commit 3b4b47a
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 153 deletions.
2 changes: 1 addition & 1 deletion book/providers/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ use std::sync::Arc;

abigen!(
IUniswapV2Pair,
r#"[function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)]"#
"[function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)]"
);

#[tokio::main]
Expand Down
32 changes: 16 additions & 16 deletions ethers-contract/ethers-contract-abigen/src/multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,12 +881,12 @@ mod tests {

let human_readable = Abigen::new(
"HrContract",
r#"[
r"[
struct Foo { uint256 x; }
function foo(Foo memory x)
function bar(uint256 x, uint256 y, address addr)
yeet(uint256,uint256,address)
]"#,
]",
)
.unwrap();

Expand Down Expand Up @@ -1001,9 +1001,9 @@ mod tests {
multi_gen.push(
Abigen::new(
"AdditionalContract",
r#"[
r"[
getValue() (uint256)
]"#,
]",
)
.unwrap(),
);
Expand All @@ -1028,9 +1028,9 @@ mod tests {
multi_gen.push(
Abigen::new(
"AdditionalContract",
r#"[
r"[
getValue() (uint256)
]"#,
]",
)
.unwrap(),
);
Expand Down Expand Up @@ -1062,9 +1062,9 @@ mod tests {
multi_gen.push(
Abigen::new(
"AdditionalContract",
r#"[
r"[
getValue() (uint256)
]"#,
]",
)
.unwrap(),
);
Expand Down Expand Up @@ -1099,9 +1099,9 @@ mod tests {
multi_gen.push(
Abigen::new(
"AdditionalContract",
r#"[
r"[
getValue() (uint256)
]"#,
]",
)
.unwrap(),
);
Expand All @@ -1121,11 +1121,11 @@ mod tests {
fn does_not_generate_shared_types_if_empty() {
let gen = Abigen::new(
"Greeter",
r#"[
r"[
struct Inner {bool a;}
greet1() (uint256)
greet2(Inner inner) (string)
]"#,
]",
)
.unwrap();

Expand All @@ -1137,9 +1137,9 @@ mod tests {
fn can_filter_abigen() {
let abi = Abigen::new(
"MyGreeter",
r#"[
r"[
greet() (string)
]"#,
]",
)
.unwrap();
let mut gen = MultiAbigen::from_abigens(vec![abi]).with_filter(ContractFilter::All);
Expand Down Expand Up @@ -1167,9 +1167,9 @@ mod tests {
gen.push(
Abigen::new(
"MyGreeterTest",
r#"[
r"[
greet() (string)
]"#,
]",
)
.unwrap(),
);
Expand Down
2 changes: 1 addition & 1 deletion ethers-contract/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub type Contract<M> = ContractInstance<std::sync::Arc<M>, M>;
/// use ethers_core::abi::{Detokenize, Token, InvalidOutputType};
/// # // this is a fake address used just for this example
/// # let address = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee".parse::<Address>()?;
/// # let abi: Abi = serde_json::from_str(r#"[]"#)?;
/// # let abi: Abi = serde_json::from_str("[]")?;
/// # let client = Provider::<Http>::try_from("http://localhost:8545").unwrap();
/// # let contract = Contract::new(address, abi, Arc::new(client));
///
Expand Down
4 changes: 2 additions & 2 deletions ethers-core/src/abi/human_readable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ impl AbiParser {
///
/// ```
/// # use ethers_core::abi::AbiParser;
/// let abi = AbiParser::default().parse_str(r#"[
/// let abi = AbiParser::default().parse_str("[
/// function setValue(string)
/// function getValue() external view returns (string)
/// event ValueChanged(address indexed author, string oldValue, string newValue)
/// ]"#).unwrap();
/// ]").unwrap();
/// ```
pub fn parse_str(&mut self, s: &str) -> Result<Abi> {
self.parse(
Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/types/syncing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ mod tests {

#[test]
fn deserialize_sync_false() {
let s = r#"false"#;
let s = r"false";

let sync: SyncingStatus = serde_json::from_str(s).unwrap();
match sync {
Expand Down
2 changes: 1 addition & 1 deletion ethers-core/src/types/trace/geth/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod tests {
use super::*;
use crate::types::*;

const DEFAULT: &str = r#"{}"#;
const DEFAULT: &str = r"{}";

#[test]
fn test_serialize_noop_trace() {
Expand Down
2 changes: 1 addition & 1 deletion ethers-providers/src/rpc/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
_tx: &TypedTransaction,
_from: Address,
) -> Result<Signature, Self::Error> {
Err(ProviderError::SignerUnavailable).map_err(MiddlewareError::from_err)
Err(MiddlewareError::from_err(ProviderError::SignerUnavailable))
}

////// Contract state
Expand Down
4 changes: 2 additions & 2 deletions ethers-solc/src/compile/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,12 @@ mod tests {

tmp.add_source(
"C",
r#"
r"
pragma solidity ^0.8.10;
contract C {
function hello() public {}
}
"#,
",
)
.unwrap();
let compiled = tmp.compile().unwrap();
Expand Down
12 changes: 6 additions & 6 deletions ethers-solc/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ mod tests {
let non_existing = path.join("test.sol");
std::fs::write(
existing,
r#"
"
pragma solidity ^0.8.10;
contract A {}
"#,
",
)
.unwrap();

Expand Down Expand Up @@ -592,7 +592,7 @@ contract A {}

#[test]
fn can_find_single_quote_imports() {
let content = r#"
let content = r"
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
Expand All @@ -601,7 +601,7 @@ import '@openzeppelin/contracts/utils/Address.sol';
import './../interfaces/IJBDirectory.sol';
import './../libraries/JBTokens.sol';
"#;
";
let imports: Vec<_> = find_import_paths(content).map(|m| m.as_str()).collect();

assert_eq!(
Expand Down Expand Up @@ -631,9 +631,9 @@ import { T } from '../Test2.sol';
}
#[test]
fn can_find_version() {
let s = r##"//SPDX-License-Identifier: Unlicense
let s = r"//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
"##;
";
assert_eq!(Some("^0.8.0"), find_version_pragma(s).map(|s| s.as_str()));
}

Expand Down

0 comments on commit 3b4b47a

Please sign in to comment.