Skip to content

Commit 95a8a78

Browse files
committed
Removed force_multiline_blocks modification
1 parent feeef68 commit 95a8a78

26 files changed

+824
-992
lines changed

.rustfmt.toml

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ normalize_comments = true # changed
33
imports_layout = "Vertical" # changed
44
imports_granularity = "Crate" # changed
55
combine_control_expr = false # changed
6-
force_multiline_blocks = true # changed
76
trailing_semicolon = false # changed
87
edition = "2021" # changed
98
use_try_shorthand = true # changed

fuel-client/src/client/schema.rs

+12-16
Original file line numberDiff line numberDiff line change
@@ -270,22 +270,18 @@ pub struct PaginationRequest<T> {
270270
impl<T: Into<String>> From<PaginationRequest<T>> for ConnectionArgs {
271271
fn from(req: PaginationRequest<T>) -> Self {
272272
match req.direction {
273-
PageDirection::Forward => {
274-
Self {
275-
after: req.cursor.map(Into::into),
276-
before: None,
277-
first: Some(req.results as i32),
278-
last: None,
279-
}
280-
}
281-
PageDirection::Backward => {
282-
Self {
283-
after: None,
284-
before: req.cursor.map(Into::into),
285-
first: None,
286-
last: Some(req.results as i32),
287-
}
288-
}
273+
PageDirection::Forward => Self {
274+
after: req.cursor.map(Into::into),
275+
before: None,
276+
first: Some(req.results as i32),
277+
last: None,
278+
},
279+
PageDirection::Backward => Self {
280+
after: None,
281+
before: req.cursor.map(Into::into),
282+
first: None,
283+
last: Some(req.results as i32),
284+
},
289285
}
290286
}
291287
}

fuel-client/src/client/schema/balance.rs

+14-18
Original file line numberDiff line numberDiff line change
@@ -53,24 +53,20 @@ pub struct BalancesConnectionArgs {
5353
impl From<(Address, PaginationRequest<String>)> for BalancesConnectionArgs {
5454
fn from(r: (Address, PaginationRequest<String>)) -> Self {
5555
match r.1.direction {
56-
PageDirection::Forward => {
57-
BalancesConnectionArgs {
58-
filter: BalanceFilterInput { owner: r.0 },
59-
after: r.1.cursor,
60-
before: None,
61-
first: Some(r.1.results as i32),
62-
last: None,
63-
}
64-
}
65-
PageDirection::Backward => {
66-
BalancesConnectionArgs {
67-
filter: BalanceFilterInput { owner: r.0 },
68-
after: None,
69-
before: r.1.cursor,
70-
first: None,
71-
last: Some(r.1.results as i32),
72-
}
73-
}
56+
PageDirection::Forward => BalancesConnectionArgs {
57+
filter: BalanceFilterInput { owner: r.0 },
58+
after: r.1.cursor,
59+
before: None,
60+
first: Some(r.1.results as i32),
61+
last: None,
62+
},
63+
PageDirection::Backward => BalancesConnectionArgs {
64+
filter: BalanceFilterInput { owner: r.0 },
65+
after: None,
66+
before: r.1.cursor,
67+
first: None,
68+
last: Some(r.1.results as i32),
69+
},
7470
}
7571
}
7672
}

fuel-client/src/client/schema/coin.rs

+20-24
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,26 @@ pub struct CoinsConnectionArgs {
5555
impl From<(Address, AssetId, PaginationRequest<String>)> for CoinsConnectionArgs {
5656
fn from(r: (Address, AssetId, PaginationRequest<String>)) -> Self {
5757
match r.2.direction {
58-
PageDirection::Forward => {
59-
CoinsConnectionArgs {
60-
filter: CoinFilterInput {
61-
owner: r.0,
62-
asset_id: Some(r.1),
63-
},
64-
after: r.2.cursor,
65-
before: None,
66-
first: Some(r.2.results as i32),
67-
last: None,
68-
}
69-
}
70-
PageDirection::Backward => {
71-
CoinsConnectionArgs {
72-
filter: CoinFilterInput {
73-
owner: r.0,
74-
asset_id: Some(r.1),
75-
},
76-
after: None,
77-
before: r.2.cursor,
78-
first: None,
79-
last: Some(r.2.results as i32),
80-
}
81-
}
58+
PageDirection::Forward => CoinsConnectionArgs {
59+
filter: CoinFilterInput {
60+
owner: r.0,
61+
asset_id: Some(r.1),
62+
},
63+
after: r.2.cursor,
64+
before: None,
65+
first: Some(r.2.results as i32),
66+
last: None,
67+
},
68+
PageDirection::Backward => CoinsConnectionArgs {
69+
filter: CoinFilterInput {
70+
owner: r.0,
71+
asset_id: Some(r.1),
72+
},
73+
after: None,
74+
before: r.2.cursor,
75+
first: None,
76+
last: Some(r.2.results as i32),
77+
},
8278
}
8379
}
8480
}

fuel-client/src/client/schema/contract.rs

+14-18
Original file line numberDiff line numberDiff line change
@@ -129,24 +129,20 @@ impl From<ContractBalanceConnection> for PaginatedResult<ContractBalance, String
129129
impl From<(ContractId, PaginationRequest<String>)> for ContractBalancesConnectionArgs {
130130
fn from(r: (ContractId, PaginationRequest<String>)) -> Self {
131131
match r.1.direction {
132-
PageDirection::Forward => {
133-
ContractBalancesConnectionArgs {
134-
filter: ContractBalanceFilterInput { contract: r.0 },
135-
after: r.1.cursor,
136-
before: None,
137-
first: Some(r.1.results as i32),
138-
last: None,
139-
}
140-
}
141-
PageDirection::Backward => {
142-
ContractBalancesConnectionArgs {
143-
filter: ContractBalanceFilterInput { contract: r.0 },
144-
after: None,
145-
before: r.1.cursor,
146-
first: None,
147-
last: Some(r.1.results as i32),
148-
}
149-
}
132+
PageDirection::Forward => ContractBalancesConnectionArgs {
133+
filter: ContractBalanceFilterInput { contract: r.0 },
134+
after: r.1.cursor,
135+
before: None,
136+
first: Some(r.1.results as i32),
137+
last: None,
138+
},
139+
PageDirection::Backward => ContractBalancesConnectionArgs {
140+
filter: ContractBalanceFilterInput { contract: r.0 },
141+
after: None,
142+
before: r.1.cursor,
143+
first: None,
144+
last: Some(r.1.results as i32),
145+
},
150146
}
151147
}
152148
}

fuel-client/src/client/schema/message.rs

+14-18
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,20 @@ pub struct OwnedMessagesConnectionArgs {
6666
impl From<(Option<Address>, PaginationRequest<String>)> for OwnedMessagesConnectionArgs {
6767
fn from(r: (Option<Address>, PaginationRequest<String>)) -> Self {
6868
match r.1.direction {
69-
PageDirection::Forward => {
70-
OwnedMessagesConnectionArgs {
71-
owner: r.0,
72-
after: r.1.cursor,
73-
before: None,
74-
first: Some(r.1.results as i32),
75-
last: None,
76-
}
77-
}
78-
PageDirection::Backward => {
79-
OwnedMessagesConnectionArgs {
80-
owner: r.0,
81-
after: None,
82-
before: r.1.cursor,
83-
first: None,
84-
last: Some(r.1.results as i32),
85-
}
86-
}
69+
PageDirection::Forward => OwnedMessagesConnectionArgs {
70+
owner: r.0,
71+
after: r.1.cursor,
72+
before: None,
73+
first: Some(r.1.results as i32),
74+
last: None,
75+
},
76+
PageDirection::Backward => OwnedMessagesConnectionArgs {
77+
owner: r.0,
78+
after: None,
79+
before: r.1.cursor,
80+
first: None,
81+
last: Some(r.1.results as i32),
82+
},
8783
}
8884
}
8985
}

fuel-client/src/client/schema/tx.rs

+29-39
Original file line numberDiff line numberDiff line change
@@ -141,27 +141,21 @@ impl TryFrom<ProgramState> for fuel_vm::prelude::ProgramState {
141141

142142
fn try_from(state: ProgramState) -> Result<Self, Self::Error> {
143143
Ok(match state.return_type {
144-
ReturnType::Return => {
145-
fuel_vm::prelude::ProgramState::Return({
146-
let b = state.data.0 .0;
147-
let b: [u8; 8] =
148-
b.try_into().map_err(|_| ConversionError::BytesLength)?;
149-
u64::from_be_bytes(b)
150-
})
151-
}
152-
ReturnType::ReturnData => {
153-
fuel_vm::prelude::ProgramState::ReturnData({
154-
Bytes32::try_from(state.data.0 .0.as_slice())?
155-
})
156-
}
157-
ReturnType::Revert => {
158-
fuel_vm::prelude::ProgramState::Revert({
159-
let b = state.data.0 .0;
160-
let b: [u8; 8] =
161-
b.try_into().map_err(|_| ConversionError::BytesLength)?;
162-
u64::from_be_bytes(b)
163-
})
164-
}
144+
ReturnType::Return => fuel_vm::prelude::ProgramState::Return({
145+
let b = state.data.0 .0;
146+
let b: [u8; 8] =
147+
b.try_into().map_err(|_| ConversionError::BytesLength)?;
148+
u64::from_be_bytes(b)
149+
}),
150+
ReturnType::ReturnData => fuel_vm::prelude::ProgramState::ReturnData({
151+
Bytes32::try_from(state.data.0 .0.as_slice())?
152+
}),
153+
ReturnType::Revert => fuel_vm::prelude::ProgramState::Revert({
154+
let b = state.data.0 .0;
155+
let b: [u8; 8] =
156+
b.try_into().map_err(|_| ConversionError::BytesLength)?;
157+
u64::from_be_bytes(b)
158+
}),
165159
})
166160
}
167161
}
@@ -216,24 +210,20 @@ pub struct TransactionsByOwnerConnectionArgs {
216210
impl From<(Address, PaginationRequest<String>)> for TransactionsByOwnerConnectionArgs {
217211
fn from(r: (Address, PaginationRequest<String>)) -> Self {
218212
match r.1.direction {
219-
PageDirection::Forward => {
220-
TransactionsByOwnerConnectionArgs {
221-
owner: r.0,
222-
after: r.1.cursor,
223-
before: None,
224-
first: Some(r.1.results as i32),
225-
last: None,
226-
}
227-
}
228-
PageDirection::Backward => {
229-
TransactionsByOwnerConnectionArgs {
230-
owner: r.0,
231-
after: None,
232-
before: r.1.cursor,
233-
first: None,
234-
last: Some(r.1.results as i32),
235-
}
236-
}
213+
PageDirection::Forward => TransactionsByOwnerConnectionArgs {
214+
owner: r.0,
215+
after: r.1.cursor,
216+
before: None,
217+
first: Some(r.1.results as i32),
218+
last: None,
219+
},
220+
PageDirection::Backward => TransactionsByOwnerConnectionArgs {
221+
owner: r.0,
222+
after: None,
223+
before: r.1.cursor,
224+
first: None,
225+
last: Some(r.1.results as i32),
226+
},
237227
}
238228
}
239229
}

0 commit comments

Comments
 (0)