From 4dc7c6e69675d474e5e42e09620525e88215bef9 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 16 Jul 2016 22:50:35 -0700 Subject: [PATCH] Use git2::Config without the module prefix --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index d23843096d372cde7db376a763c62461f4bc6b80..56a96423a9587a7f8048c44fd3de94c9cfa215f2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ use std::io::Write as IoWrite; use std::process::Command; use chrono::offset::TimeZone; use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches, SubCommand}; -use git2::{Commit, Diff, ObjectType, Oid, Reference, Repository, TreeBuilder}; +use git2::{Config, Commit, Diff, ObjectType, Oid, Reference, Repository, TreeBuilder}; use tempdir::TempDir; quick_error! { @@ -508,7 +508,7 @@ fn delete(repo: &Repository, m: &ArgMatches) -> Result<()> { Ok(()) } -fn get_editor(config: &git2::Config) -> Result { +fn get_editor(config: &Config) -> Result { if let Some(e) = env::var_os("GIT_EDITOR") { return Ok(e); } @@ -535,7 +535,7 @@ fn get_editor(config: &git2::Config) -> Result { // Get the pager to use; with for_cmd set, get the pager for use by the // specified git command. If get_pager returns None, don't use a pager. -fn get_pager(config: &git2::Config, for_cmd: &str, default: bool) -> Option { +fn get_pager(config: &Config, for_cmd: &str, default: bool) -> Option { if !isatty::stdout_isatty() { return None; } @@ -544,7 +544,7 @@ fn get_pager(config: &git2::Config, for_cmd: &str, default: bool) -> Option>(program: S, args: bool) -> Command { } } -fn run_editor>(config: &git2::Config, filename: S) -> Result<()> { +fn run_editor>(config: &Config, filename: S) -> Result<()> { let editor = try!(get_editor(&config)); let editor_status = try!(cmd_maybe_shell(editor, true).arg(&filename).status()); if !editor_status.success() { @@ -605,7 +605,7 @@ impl Output { Output { pager: None, include_stderr: false } } - fn auto_pager(&mut self, config: &git2::Config, for_cmd: &str, default: bool) -> Result<()> { + fn auto_pager(&mut self, config: &Config, for_cmd: &str, default: bool) -> Result<()> { if let Some(pager) = get_pager(config, for_cmd, default) { let mut cmd = cmd_maybe_shell(pager, false); cmd.stdin(std::process::Stdio::piped()); @@ -660,7 +660,7 @@ impl IoWrite for Output { } } -fn get_signature(config: &git2::Config, which: &str) -> Result> { +fn get_signature(config: &Config, which: &str) -> Result> { let name_var = ["GIT_", which, "_NAME"].concat(); let email_var = ["GIT_", which, "_EMAIL"].concat(); let which_lc = which.to_lowercase();