Skip to content

Commit

Permalink
fix: task name of reclamation algorithm (#336)
Browse files Browse the repository at this point in the history
Part of #335
  • Loading branch information
wangl-cc authored Oct 12, 2024
1 parent 3fd7bfa commit 6ac297d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions maa-cli/src/run/preset/reclamation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct ReclamationParams {

impl super::ToTaskType for ReclamationParams {
fn to_task_type(&self) -> super::TaskType {
super::TaskType::ReclamationAlgorithm
super::TaskType::Reclamation
}
}

Expand Down Expand Up @@ -121,7 +121,7 @@ mod tests {
match command {
crate::Command::Reclamation { params, .. } => {
use super::super::{TaskType, ToTaskType};
assert_eq!(params.to_task_type(), TaskType::ReclamationAlgorithm);
assert_eq!(params.to_task_type(), TaskType::Reclamation);
params.into()
}
_ => panic!("Not a Reclamation command"),
Expand Down
15 changes: 6 additions & 9 deletions maa-sys/src/task_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum TaskType {
SSSCopilot,
Depot,
OperBox,
ReclamationAlgorithm,
Reclamation,
Custom,
SingleStep,
VideoRecognition,
Expand Down Expand Up @@ -55,7 +55,7 @@ impl TaskType {
Self::SSSCopilot => "SSSCopilot",
Self::Depot => "Depot",
Self::OperBox => "OperBox",
Self::ReclamationAlgorithm => "ReclamationAlgorithm",
Self::Reclamation => "Reclamation",
Self::Custom => "Custom",
Self::SingleStep => "SingleStep",
Self::VideoRecognition => "VideoRecognition",
Expand Down Expand Up @@ -164,7 +164,7 @@ mod tests {
assert_eq!("SSSCopilot".parse(), Ok(SSSCopilot));
assert_eq!("Depot".parse(), Ok(Depot));
assert_eq!("OperBox".parse(), Ok(OperBox));
assert_eq!("ReclamationAlgorithm".parse(), Ok(ReclamationAlgorithm));
assert_eq!("Reclamation".parse(), Ok(Reclamation));
assert_eq!("Custom".parse(), Ok(Custom));
assert_eq!("SingleStep".parse(), Ok(SingleStep));
assert_eq!("VideoRecognition".parse(), Ok(VideoRecognition));
Expand All @@ -176,7 +176,7 @@ mod tests {
UnknownTaskType("Unknown".to_owned()).to_string(),
"unknown task type `Unknown`, expected one of `StartUp`, `CloseDown`, `Fight`, \
`Recruit`, `Infrast`, `Mall`, `Award`, `Roguelike`, `Copilot`, `SSSCopilot`, \
`Depot`, `OperBox`, `ReclamationAlgorithm`, `Custom`, `SingleStep`, `VideoRecognition`",
`Depot`, `OperBox`, `Reclamation`, `Custom`, `SingleStep`, `VideoRecognition`",
);
}

Expand Down Expand Up @@ -204,7 +204,7 @@ mod tests {
&[Token::Str("Unknown")],
"unknown variant `Unknown`, expected one of `StartUp`, `CloseDown`, `Fight`, \
`Recruit`, `Infrast`, `Mall`, `Award`, `Roguelike`, `Copilot`, `SSSCopilot`, \
`Depot`, `OperBox`, `ReclamationAlgorithm`, `Custom`, `SingleStep`, `VideoRecognition`",
`Depot`, `OperBox`, `Reclamation`, `Custom`, `SingleStep`, `VideoRecognition`",
);
}
}
Expand All @@ -223,10 +223,7 @@ mod tests {
assert_eq!(SSSCopilot.to_str(), "SSSCopilot");
assert_eq!(Depot.to_str(), "Depot");
assert_eq!(OperBox.to_str(), "OperBox");
assert_eq!(
TaskType::ReclamationAlgorithm.to_str(),
"ReclamationAlgorithm",
);
assert_eq!(Reclamation.to_str(), "Reclamation",);
assert_eq!(Custom.to_str(), "Custom");
assert_eq!(SingleStep.to_str(), "SingleStep");
assert_eq!(VideoRecognition.to_str(), "VideoRecognition");
Expand Down

0 comments on commit 6ac297d

Please sign in to comment.