Skip to content

Commit 3633640

Browse files
authored
chore: update derive_more to version 2.0.1 (#4606)
1 parent b01a769 commit 3633640

File tree

32 files changed

+305
-316
lines changed

32 files changed

+305
-316
lines changed

Cargo.lock

Lines changed: 30 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ color-eyre = "0.6.3"
132132
colored = "2.1.0"
133133
const-str = "0.5"
134134
defer = "0.2.1"
135-
derive_more = "0.99.18"
135+
derive_more = { version = "2.0.1", default-features = false, features = ["full"] }
136136
dirs = "4.0.0"
137137
dyn-clonable = "0.9.0"
138138
enum-iterator = "1.5.0"

common/numerated/src/interval.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use num_traits::{
3333

3434
/// Describes not empty interval start..=end.
3535
#[derive(Clone, Copy, PartialEq, Eq, derive_more::Display)]
36-
#[display(fmt = "{}..={}", start, end)]
36+
#[display("{start}..={end}")]
3737
pub struct Interval<T> {
3838
start: T,
3939
end: T,

core-backend/src/env.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,17 +77,17 @@ pub type EnvironmentExecutionResult<Ext> = Result<BackendReport<Ext>, Environmen
7777

7878
#[derive(Debug, derive_more::Display)]
7979
pub enum EnvironmentError {
80-
#[display(fmt = "Actor backend error: {_1}")]
80+
#[display("Actor backend error: {_1}")]
8181
Actor(GasAmount, String),
82-
#[display(fmt = "System backend error: {_0}")]
82+
#[display("System backend error: {_0}")]
8383
System(SystemEnvironmentError),
8484
}
8585

8686
#[derive(Debug, derive_more::Display)]
8787
pub enum SystemEnvironmentError {
88-
#[display(fmt = "Failed to create env memory: {_0:?}")]
88+
#[display("Failed to create env memory: {_0:?}")]
8989
CreateEnvMemory(gear_sandbox::Error),
90-
#[display(fmt = "Gas counter not found or has wrong type")]
90+
#[display("Gas counter not found or has wrong type")]
9191
WrongInjectedGas,
9292
}
9393

core-backend/src/error.rs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub enum ActorTerminationReason {
8181
Success,
8282
Wait(Option<u32>, MessageWaitedType),
8383
GasAllowanceExceeded,
84-
#[from]
8584
Trap(TrapExplanation),
8685
}
8786

@@ -116,15 +115,15 @@ pub struct SystemTerminationReason;
116115
derive_more::From,
117116
)]
118117
pub enum UnrecoverableExecutionError {
119-
#[display(fmt = "Invalid debug string passed in `gr_debug` syscall")]
118+
#[display("Invalid debug string passed in `gr_debug` syscall")]
120119
InvalidDebugString,
121-
#[display(fmt = "Not enough gas for operation")]
120+
#[display("Not enough gas for operation")]
122121
NotEnoughGas,
123-
#[display(fmt = "Cannot take data in payload range from message with size")]
122+
#[display("Cannot take data in payload range from message with size")]
124123
ReadWrongRange,
125-
#[display(fmt = "Unsupported version of environment variables encountered")]
124+
#[display("Unsupported version of environment variables encountered")]
126125
UnsupportedEnvVarsVersion,
127-
#[display(fmt = "Length is overflowed to read panic payload")]
126+
#[display("Length is overflowed to read panic payload")]
128127
PanicBufferIsTooBig,
129128
}
130129

@@ -143,10 +142,10 @@ pub enum UnrecoverableExecutionError {
143142
)]
144143
pub enum UnrecoverableMemoryError {
145144
/// The error occurs in attempt to access memory outside wasm program memory.
146-
#[display(fmt = "Trying to access memory outside wasm program memory")]
145+
#[display("Trying to access memory outside wasm program memory")]
147146
AccessOutOfBounds,
148147
/// The error occurs, when program tries to allocate in block-chain runtime more memory than allowed.
149-
#[display(fmt = "Trying to allocate more memory in block-chain runtime than allowed")]
148+
#[display("Trying to allocate more memory in block-chain runtime than allowed")]
150149
RuntimeAllocOutOfBounds,
151150
}
152151

@@ -165,10 +164,10 @@ pub enum UnrecoverableMemoryError {
165164
)]
166165
pub enum UnrecoverableWaitError {
167166
/// An error occurs in attempt to wait for or wait up to zero blocks.
168-
#[display(fmt = "Waiting duration cannot be zero")]
167+
#[display("Waiting duration cannot be zero")]
169168
ZeroDuration,
170169
/// An error occurs in attempt to wait after reply sent.
171-
#[display(fmt = "`wait()` is not allowed after reply sent")]
170+
#[display("`wait()` is not allowed after reply sent")]
172171
WaitAfterReply,
173172
}
174173

@@ -185,11 +184,11 @@ pub enum UnrecoverableWaitError {
185184
derive_more::From,
186185
)]
187186
pub enum UnrecoverableExtError {
188-
#[display(fmt = "Execution error: {_0}")]
187+
#[display("Execution error: {_0}")]
189188
Execution(UnrecoverableExecutionError),
190-
#[display(fmt = "Memory error: {_0}")]
189+
#[display("Memory error: {_0}")]
191190
Memory(UnrecoverableMemoryError),
192-
#[display(fmt = "Waiting error: {_0}")]
191+
#[display("Waiting error: {_0}")]
193192
Wait(UnrecoverableWaitError),
194193
}
195194

@@ -207,22 +206,22 @@ pub enum UnrecoverableExtError {
207206
)]
208207
pub enum TrapExplanation {
209208
/// An error occurs in attempt to charge more gas than available during execution.
210-
#[display(fmt = "Not enough gas to continue execution")]
209+
#[display("Not enough gas to continue execution")]
211210
GasLimitExceeded,
212211
/// An error occurs in attempt to call forbidden syscall.
213-
#[display(fmt = "Unable to call a forbidden function")]
212+
#[display("Unable to call a forbidden function")]
214213
ForbiddenFunction,
215214
/// The error occurs when a program tries to allocate more memory than
216215
/// allowed.
217-
#[display(fmt = "Trying to allocate more wasm program memory than allowed")]
216+
#[display("Trying to allocate more wasm program memory than allowed")]
218217
ProgramAllocOutOfBounds,
219-
#[display(fmt = "Syscall unrecoverable error: {_0}")]
218+
#[display("Syscall unrecoverable error: {_0}")]
220219
UnrecoverableExt(UnrecoverableExtError),
221-
#[display(fmt = "Panic occurred: {_0}")]
220+
#[display("Panic occurred: {_0}")]
222221
Panic(PanicBuffer),
223-
#[display(fmt = "Stack limit exceeded")]
222+
#[display("Stack limit exceeded")]
224223
StackLimitExceeded,
225-
#[display(fmt = "Reason is unknown. Possibly `unreachable` instruction is occurred")]
224+
#[display("Reason is unknown. Possibly `unreachable` instruction is occurred")]
226225
Unknown,
227226
}
228227

0 commit comments

Comments
 (0)