Skip to content

Commit

Permalink
Update enums.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiDrang committed Jan 11, 2025
1 parent d24fb16 commit df25510
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/enums.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::fmt;

pub trait TaskTypeTrait {
/// `TaskTypeTrait` analog for `to_string()`
fn as_string(&self) -> String;
}

Expand All @@ -10,6 +11,7 @@ pub enum ImageTaskType {
ImageToCoordinatesTask,
}
impl TaskTypeTrait for ImageTaskType {
/// `ImageTaskType` analog for `to_string()`
fn as_string(&self) -> String {
format!("{:?}", &self)
}
Expand Down Expand Up @@ -38,6 +40,7 @@ pub enum TokenTaskType {
AntiGateTask,
}
impl TaskTypeTrait for TokenTaskType {
/// `TokenTaskType` analog for `to_string()`
fn as_string(&self) -> String {
format!("{:?}", &self)
}
Expand All @@ -61,6 +64,7 @@ pub enum EnpPostfix {
pushAntiGateVariable,
}
impl fmt::Display for EnpPostfix {
/// `EnpPostfix` formatter
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self)
}
Expand All @@ -73,6 +77,7 @@ pub enum GetResultStatus {
error,
}
impl fmt::Display for GetResultStatus {
/// `GetResultStatus` formatter
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}", self)
}
Expand Down

0 comments on commit df25510

Please sign in to comment.