@@ -3,14 +3,13 @@ use std::{
3
3
process:: { Command , Stdio } ,
4
4
} ;
5
5
6
- use crate :: Identity ;
7
6
use quick_error:: quick_error;
8
7
9
- /// The result used in [`helper ()`].
8
+ /// The result used in [`action ()`].
10
9
pub type Result = std:: result:: Result < Option < Outcome > , Error > ;
11
10
12
11
quick_error ! {
13
- /// The error used in the [credentials helper][helper ()].
12
+ /// The error used in the [credentials helper][action ()].
14
13
#[ derive( Debug ) ]
15
14
#[ allow( missing_docs) ]
16
15
pub enum Error {
@@ -28,7 +27,7 @@ quick_error! {
28
27
}
29
28
}
30
29
31
- /// The action to perform by the credentials [`helper ()`].
30
+ /// The action to perform by the credentials [`action ()`].
32
31
#[ derive( Clone , Debug ) ]
33
32
pub enum Action < ' a > {
34
33
/// Provide credentials using the given repository URL (as &str) as context.
@@ -69,11 +68,11 @@ impl NextAction {
69
68
}
70
69
}
71
70
72
- /// The outcome of [`helper ()`].
71
+ /// The outcome of [`action ()`].
73
72
pub struct Outcome {
74
73
/// The obtained identity.
75
- pub identity : Identity ,
76
- /// A handle to the action to perform next using another call to [`helper ()`].
74
+ pub identity : git_sec :: Identity ,
75
+ /// A handle to the action to perform next using another call to [`action ()`].
77
76
pub next : NextAction ,
78
77
}
79
78
@@ -91,7 +90,7 @@ fn git_program() -> &'static str {
91
90
///
92
91
/// Usually the first call is performed with [`Action::Fill`] to obtain an identity, which subsequently can be used.
93
92
/// On successful usage, use [`NextAction::approve()`], otherwise [`NextAction::reject()`].
94
- pub fn helper ( action : Action < ' _ > ) -> Result {
93
+ pub fn action ( action : Action < ' _ > ) -> Result {
95
94
let mut cmd = Command :: new ( git_program ( ) ) ;
96
95
cmd. arg ( "credential" )
97
96
. arg ( action. as_str ( ) )
@@ -128,7 +127,7 @@ pub fn helper(action: Action<'_>) -> Result {
128
127
. map ( |( _, n) | n. to_owned ( ) )
129
128
} ;
130
129
Ok ( Some ( Outcome {
131
- identity : Identity :: Account {
130
+ identity : git_sec :: Identity :: Account {
132
131
username : find ( "username" ) ?,
133
132
password : find ( "password" ) ?,
134
133
} ,
0 commit comments