aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/git-sugpatch.rs
diff options
context:
space:
mode:
authorTeddy Wing2020-08-02 04:44:48 +0200
committerTeddy Wing2020-08-02 04:44:48 +0200
commit1d9cea6cdb473ed3044683853b6f8b6b35891258 (patch)
tree44a8267c70318aae4152c7b41b6d660e02c1e22e /src/bin/git-sugpatch.rs
parent38a871f28bad90e238021d8cc46b9fa926f9df75 (diff)
downloadgit-suggestion-1d9cea6cdb473ed3044683853b6f8b6b35891258.tar.bz2
git-sugpatch: Clean up after 38a871f28bad90e238021d8cc46b9fa926f9df75
Remove unused code.
Diffstat (limited to 'src/bin/git-sugpatch.rs')
-rw-r--r--src/bin/git-sugpatch.rs88
1 files changed, 2 insertions, 86 deletions
diff --git a/src/bin/git-sugpatch.rs b/src/bin/git-sugpatch.rs
index 4560c9a..0499c62 100644
--- a/src/bin/git-sugpatch.rs
+++ b/src/bin/git-sugpatch.rs
@@ -3,10 +3,9 @@ use std::process;
use exitcode;
-use github_suggestion::{Client, Suggestion, SuggestionUrl};
-use github_suggestion_cli::{gseprintln, is_suggestion_id, owner_repo};
+use github_suggestion::{Client, SuggestionUrl};
+use github_suggestion_cli::{gseprintln, is_suggestion_id};
use github_suggestion_cli::config::Config;
-use github_suggestion_cli::error::Error;
fn main() {
@@ -25,17 +24,6 @@ fn main() {
process::exit(111);
}
- // let mut owner_repo_error: owner_repo::Error;
- // let o_r = match config.o_r {
- // Ok(o_r) => o_r,
- // Err(e @ owner_repo::Error::NoRemote(_)) => owner_repo_error = e,
- // Err(e) => {
- // gseprintln!(e);
- //
- // process::exit(111);
- // },
- // };
-
for suggestion_arg in config.suggestions {
let suggestion = if match is_suggestion_id(&suggestion_arg) {
Ok(p) => p,
@@ -45,27 +33,6 @@ fn main() {
process::exit(exitcode::SOFTWARE);
}
} {
- // let o_r = match config.o_r {
- // Ok(o_r) => o_r,
- // Err(e) => {
- // gseprintln!(e);
- //
- // process::exit(exitcode::CONFIG);
- // }
- // };
- // let o_r = match owner_repo {
- // Ok(o_r) => o_r,
- // Err(e) => {
- // gseprintln!(e);
- //
- // process::exit(exitcode::CONFIG);
- // },
- // };
- // if let owner_repo::Error::NoRemote(e) = owner_repo_error {
- // gseprintln!(e);
- //
- // process::exit(exitcode::CONFIG);
- // }
let o_r = match &config.o_r {
Ok(o_r) => o_r,
Err(e) => {
@@ -95,55 +62,4 @@ fn main() {
print!("{}", suggestion.diff().unwrap());
}
-
- // let suggestions: Vec<Result<Suggestion, Error>> = config.suggestions
- // .iter()
- // .map(|s| {
- // let suggestion = if is_suggestion_id(s)? {
- // let o_r = owner_repo?;
- //
- // let client = Client::new(
- // &config.github_token,
- // &o_r.owner,
- // &o_r.repo,
- // ).unwrap();
- //
- // client.fetch(&s).unwrap()
- // } else {
- // let url: SuggestionUrl = args[1].parse().unwrap();
- //
- // let client = Client::new(
- // &config.github_token,
- // &url.owner,
- // &url.repo,
- // ).unwrap();
- //
- // client.fetch(&url.comment_id).unwrap()
- // };
- //
- // Ok(suggestion)
- // })
- // .collect();
- //
- // let errors: Vec<&Error> = suggestions.iter()
- // .filter(|r| r.is_err())
- //
- // // We know these `Results` are `Err`s.
- // .map(|r| r.as_ref().err().unwrap())
- // .collect();
- //
- // if !errors.is_empty() {
- // for error in errors {
- // eprintln!("error: {}", error);
- // }
- //
- // return;
- // }
- //
- // suggestions
- // .iter()
- //
- // // We've already checked for `Err`s above.
- // .map(|r| r.as_ref().unwrap())
- // .for_each(|s| print!("{}", s.diff().unwrap()));
}