diff options
| author | Teddy Wing | 2020-08-02 04:44:48 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2020-08-02 04:44:48 +0200 | 
| commit | 1d9cea6cdb473ed3044683853b6f8b6b35891258 (patch) | |
| tree | 44a8267c70318aae4152c7b41b6d660e02c1e22e /src | |
| parent | 38a871f28bad90e238021d8cc46b9fa926f9df75 (diff) | |
| download | git-suggestion-1d9cea6cdb473ed3044683853b6f8b6b35891258.tar.bz2 | |
git-sugpatch: Clean up after 38a871f28bad90e238021d8cc46b9fa926f9df75
Remove unused code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/bin/git-sugpatch.rs | 88 | ||||
| -rw-r--r-- | src/error.rs | 5 | 
2 files changed, 2 insertions, 91 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()));  } diff --git a/src/error.rs b/src/error.rs index 3df5de7..bcca3e1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -1,16 +1,11 @@  use regex;  use thiserror::Error; -use crate::owner_repo; -  #[derive(Debug, Error)]  pub enum Error {      #[error("Unable to parse regex")]      Regex(#[from] regex::Error), - -    #[error(transparent)] -    NoRemote(#[from] owner_repo::Error),  } | 
