-
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.
feat(src): implement services in binary
- Loading branch information
Showing
2 changed files
with
10 additions
and
1 deletion.
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,17 +1,25 @@ | ||
use std::env; | ||
pub mod services; | ||
use services::rustacean_author::RustaceanMember; | ||
|
||
use anyhow::{bail, Context, Result}; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
let args: Vec<String> = env::args().collect(); | ||
let pr_author = args.get(1).context("PR Author is required")?; | ||
let pr_number = args.get(2).context("PR Number is required")?; | ||
|
||
if pr_author.is_empty() { | ||
bail!("PR Author Cannot Be Empty!"); | ||
} | ||
|
||
println!("Hello {pr_author}!"); | ||
let rustacean = RustaceanMember::new(pr_author.to_string(), pr_number.to_string()); | ||
|
||
let rustacean_valid = | ||
services::rustacean_author::RustaceanMember::is_rustacean_valid(&rustacean).await?; | ||
|
||
println!("Hello {pr_author} your PR number is {pr_number}, and you are {rustacean_valid}"); | ||
|
||
Ok(()) | ||
} |
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 @@ | ||
pub mod rustacean_author; |