@@ -22,13 +22,13 @@ impl<'repo> Snapshot<'repo> {
22
22
/// For a non-degenerating version, use [`try_boolean(…)`][Self::try_boolean()].
23
23
///
24
24
/// Note that this method takes the most recent value at `key` even if it is from a file with reduced trust.
25
- pub fn boolean < ' a > ( & self , key : impl Into < & ' a BStr > ) -> Option < bool > {
25
+ pub fn boolean ( & self , key : impl gix_config :: AsKey ) -> Option < bool > {
26
26
self . try_boolean ( key) . and_then ( Result :: ok)
27
27
}
28
28
29
29
/// Like [`boolean()`][Self::boolean()], but it will report an error if the value couldn't be interpreted as boolean.
30
- pub fn try_boolean < ' a > ( & self , key : impl Into < & ' a BStr > ) -> Option < Result < bool , gix_config:: value:: Error > > {
31
- self . repo . config . resolved . boolean ( key. into ( ) )
30
+ pub fn try_boolean ( & self , key : impl gix_config :: AsKey ) -> Option < Result < bool , gix_config:: value:: Error > > {
31
+ self . repo . config . resolved . boolean ( key)
32
32
}
33
33
34
34
/// Return the resolved integer at `key`, or `None` if there is no such value or if the value can't be interpreted as
@@ -37,40 +37,40 @@ impl<'repo> Snapshot<'repo> {
37
37
/// For a non-degenerating version, use [`try_integer(…)`][Self::try_integer()].
38
38
///
39
39
/// Note that this method takes the most recent value at `key` even if it is from a file with reduced trust.
40
- pub fn integer < ' a > ( & self , key : impl Into < & ' a BStr > ) -> Option < i64 > {
40
+ pub fn integer ( & self , key : impl gix_config :: AsKey ) -> Option < i64 > {
41
41
self . try_integer ( key) . and_then ( Result :: ok)
42
42
}
43
43
44
44
/// Like [`integer()`][Self::integer()], but it will report an error if the value couldn't be interpreted as boolean.
45
- pub fn try_integer < ' a > ( & self , key : impl Into < & ' a BStr > ) -> Option < Result < i64 , gix_config:: value:: Error > > {
46
- self . repo . config . resolved . integer ( key. into ( ) )
45
+ pub fn try_integer ( & self , key : impl gix_config :: AsKey ) -> Option < Result < i64 , gix_config:: value:: Error > > {
46
+ self . repo . config . resolved . integer ( key)
47
47
}
48
48
49
49
/// Return the string at `key`, or `None` if there is no such value.
50
50
///
51
51
/// Note that this method takes the most recent value at `key` even if it is from a file with reduced trust.
52
- pub fn string < ' a > ( & self , key : impl Into < & ' a BStr > ) -> Option < Cow < ' repo , BStr > > {
53
- self . repo . config . resolved . string ( key. into ( ) )
52
+ pub fn string ( & self , key : impl gix_config :: AsKey ) -> Option < Cow < ' repo , BStr > > {
53
+ self . repo . config . resolved . string ( key)
54
54
}
55
55
56
56
/// Return the trusted and fully interpolated path at `key`, or `None` if there is no such value
57
57
/// or if no value was found in a trusted file.
58
58
/// An error occurs if the path could not be interpolated to its final value.
59
- pub fn trusted_path < ' a > (
59
+ pub fn trusted_path (
60
60
& self ,
61
- key : impl Into < & ' a BStr > ,
61
+ key : impl gix_config :: AsKey ,
62
62
) -> Option < Result < Cow < ' repo , std:: path:: Path > , gix_config:: path:: interpolate:: Error > > {
63
- self . repo . config . trusted_file_path ( key. into ( ) )
63
+ self . repo . config . trusted_file_path ( key)
64
64
}
65
65
66
66
/// Return the trusted string at `key` for launching using [command::prepare()](gix_command::prepare()),
67
67
/// or `None` if there is no such value or if no value was found in a trusted file.
68
- pub fn trusted_program < ' a > ( & self , key : impl Into < & ' a BStr > ) -> Option < Cow < ' repo , OsStr > > {
68
+ pub fn trusted_program ( & self , key : impl gix_config :: AsKey ) -> Option < Cow < ' repo , OsStr > > {
69
69
let value = self
70
70
. repo
71
71
. config
72
72
. resolved
73
- . string_filter ( key. into ( ) , & mut self . repo . config . filter_config_section . clone ( ) ) ?;
73
+ . string_filter ( key, & mut self . repo . config . filter_config_section . clone ( ) ) ?;
74
74
Some ( match gix_path:: from_bstr ( value) {
75
75
Cow :: Borrowed ( v) => Cow :: Borrowed ( v. as_os_str ( ) ) ,
76
76
Cow :: Owned ( v) => Cow :: Owned ( v. into_os_string ( ) ) ,
0 commit comments