fix: Replace smart pointer with regular pointer
Apparently was not necessary and was causing clippy warnings. ``` warning: you seem to be trying to use `&Box<T>`. Consider using just `&T` --> src/encoding/models.rs:91:32 | 91 | pub protocol_state: Option<&'a Box<dyn ProtocolSim>>, | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&'a dyn ProtocolSim` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box = note: `#[warn(clippy::borrowed_box)]` on by default ```
This commit is contained in:
@@ -167,7 +167,6 @@ fn main() {
|
||||
println!(" ====== Simple swap DAI -> USDT ======");
|
||||
println!(
|
||||
"The following callback data should be sent to the filler contract, along with the \
|
||||
encoded order and signature: {:?}",
|
||||
hex_calldata
|
||||
encoded order and signature: {hex_calldata:?}"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ pub struct Swap<'a> {
|
||||
pub user_data: Option<Bytes>,
|
||||
/// Optional protocol state used to perform the swap.
|
||||
#[serde(skip)]
|
||||
pub protocol_state: Option<&'a Box<dyn ProtocolSim>>,
|
||||
pub protocol_state: Option<&'a dyn ProtocolSim>,
|
||||
}
|
||||
|
||||
impl<'a> Swap<'a> {
|
||||
@@ -98,7 +98,7 @@ impl<'a> Swap<'a> {
|
||||
token_out: Bytes,
|
||||
split: f64,
|
||||
user_data: Option<Bytes>,
|
||||
protocol_state: Option<&'a Box<dyn ProtocolSim>>,
|
||||
protocol_state: Option<&'a dyn ProtocolSim>,
|
||||
) -> Self {
|
||||
Self { component: component.into(), token_in, token_out, split, user_data, protocol_state }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user