-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(shapes): rename
shape_action
to view
- Loading branch information
Showing
11 changed files
with
23 additions
and
24 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 |
---|---|---|
@@ -1,34 +1,33 @@ | ||
mod cli; | ||
use cli::{Commands, CLI}; | ||
|
||
mod shapes; | ||
use shapes::*; | ||
|
||
use clap::Parser; | ||
use cli::{Commands, CLI}; | ||
use shapes::*; | ||
|
||
fn main() { | ||
let cli = CLI::parse(); | ||
|
||
match &cli.command { | ||
Some(Commands::Square(square::Command { base, height })) => { | ||
square::square_action(*base, *height) | ||
} | ||
Some(Commands::Circle(circle::Command { radius })) => circle::circle_action(*radius), | ||
Some(Commands::Square(square::Command { base, height })) => square::view(*base, *height), | ||
Some(Commands::Circle(circle::Command { radius })) => circle::view(*radius), | ||
Some(Commands::Triangle(triangle::Command { | ||
base, | ||
height, | ||
side_a, | ||
side_b, | ||
side_c, | ||
})) => triangle::triangle_actions(*base, *height, *side_a, *side_b, *side_c), | ||
})) => triangle::view(*base, *height, *side_a, *side_b, *side_c), | ||
Some(Commands::Trapezoid(trapezoid::Command { | ||
l_base, | ||
s_base, | ||
height, | ||
})) => trapezoid::trapezoid_actions(*s_base, *l_base, *height), | ||
})) => trapezoid::view(*s_base, *l_base, *height), | ||
Some(Commands::Rhombus(rhombus::Command { | ||
l_diagonal, | ||
s_diagonal, | ||
})) => rhombus::rhombus_actions(*s_diagonal, *l_diagonal), | ||
})) => rhombus::view(*s_diagonal, *l_diagonal), | ||
None => {} | ||
} | ||
} |
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,5 +1,5 @@ | ||
mod action; | ||
pub use action::circle_action; | ||
mod view; | ||
pub use view::view; | ||
|
||
mod command; | ||
pub use command::Command; | ||
|
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
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
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
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
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