Skip to content

Commit e4b562c

Browse files
committed
api: fix the request API
This is more ergonomic and allows for just passing a plain string around.
1 parent d2713cd commit e4b562c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/api.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ impl Keyring {
130130
/// If `target` is given, the found keyring will be linked into it. If `target` is not given
131131
/// and a new key is constructed due to the request, it will be linked into the default
132132
/// keyring (see `Keyring::set_default`).
133-
pub fn request<'a, D, I, IS, T>(description: D, info: I, target: T) -> Result<Self>
133+
pub fn request<'s, 'a, D, I, T>(description: D, info: I, target: T) -> Result<Self>
134134
where
135135
D: AsRef<str>,
136-
I: Into<Option<IS>>,
137-
IS: AsRef<str>,
136+
I: Into<Option<&'s str>>,
138137
T: Into<Option<TargetKeyring<'a>>>,
139138
{
140139
check_call_keyring(request_impl::<keytypes::Keyring>(
@@ -496,12 +495,11 @@ impl Key {
496495
/// If `target` is given, the found keyring will be linked into it. If `target` is not given
497496
/// and a new key is constructed due to the request, it will be linked into the default
498497
/// keyring (see `Keyring::set_default`).
499-
pub fn request<'a, K, D, I, IS, T>(description: D, info: I, target: T) -> Result<Self>
498+
pub fn request<'s, 'a, K, D, I, T>(description: D, info: I, target: T) -> Result<Self>
500499
where
501500
K: KeyType,
502501
D: Borrow<K::Description>,
503-
I: Into<Option<IS>>,
504-
IS: AsRef<str>,
502+
I: Into<Option<&'s str>>,
505503
T: Into<Option<TargetKeyring<'a>>>,
506504
{
507505
check_call_key(request_impl::<K>(

0 commit comments

Comments
 (0)