-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add all targets and remove failure enum
- Loading branch information
1 parent
dd26535
commit 5bc3fe4
Showing
9 changed files
with
215 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use crate::game::hexchess::Hexchess; | ||
|
||
pub fn execute(hexchess_arg: String) -> Result<String, String> { | ||
let hexchess = match Hexchess::from(hexchess_arg.as_str()) { | ||
Ok(result) => result, | ||
Err(failure) => return Err(failure.to_string()), | ||
}; | ||
|
||
let csv = hexchess | ||
.all_targets() | ||
.into_iter() | ||
.map(|x| x.to_string()) | ||
.collect::<Vec<String>>() | ||
.join(","); | ||
|
||
Ok(csv) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod all_targets; | ||
pub mod apply_sequence; | ||
pub mod get_targets; | ||
pub mod parse; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.