Skip to content

Commit f759d63

Browse files
committed
Remove unnecessary display funcs
Already impled with `fmt::Display`
1 parent 25af13b commit f759d63

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

src/handlers/execution.rs

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::fmt;
2+
13
use colored::Colorize;
24
use serde::Deserialize;
35

@@ -67,8 +69,8 @@ pub struct LimitExceeded {
6769
pub state: String,
6870
}
6971

70-
impl std::fmt::Display for LimitExceeded {
71-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
72+
impl fmt::Display for LimitExceeded {
73+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7274
let seperator = "-------------------------------";
7375
write!(
7476
f,
@@ -81,8 +83,8 @@ impl std::fmt::Display for LimitExceeded {
8183
}
8284
}
8385

84-
impl std::fmt::Display for CompileError {
85-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
86+
impl fmt::Display for CompileError {
87+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8688
let seperator = "-------------------------------";
8789
write!(
8890
f,
@@ -95,8 +97,8 @@ impl std::fmt::Display for CompileError {
9597
}
9698
}
9799

98-
impl std::fmt::Display for RuntimeError {
99-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
100+
impl fmt::Display for RuntimeError {
101+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
100102
let seperator = "-------------------------------";
101103
write!(
102104
f,
@@ -114,8 +116,8 @@ impl std::fmt::Display for RuntimeError {
114116
}
115117
}
116118

117-
impl std::fmt::Display for Success {
118-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
119+
impl fmt::Display for Success {
120+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
119121
let seperator = "-------------------------------";
120122
let part1 = format!(
121123
"{}\n\n",
@@ -199,21 +201,3 @@ impl Success {
199201
println!("{}", self);
200202
}
201203
}
202-
203-
impl LimitExceeded {
204-
pub fn display(&self) {
205-
println!("{}", self);
206-
}
207-
}
208-
209-
impl CompileError {
210-
pub fn display(&self) {
211-
println!("{}", self);
212-
}
213-
}
214-
215-
impl RuntimeError {
216-
pub fn display(&self) {
217-
println!("{}", self);
218-
}
219-
}

0 commit comments

Comments
 (0)