mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 18:37:41 +02:00
Return &str
from BasicAuth::user_id()
and BasicAuth::password()
(#249)
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
@ -93,13 +93,13 @@ pub struct BasicAuth(Basic);
|
||||
|
||||
impl BasicAuth {
|
||||
/// Returns client's user-ID.
|
||||
pub fn user_id(&self) -> &Cow<'static, str> {
|
||||
self.0.user_id()
|
||||
pub fn user_id(&self) -> &str {
|
||||
self.0.user_id().as_ref()
|
||||
}
|
||||
|
||||
/// Returns client's password.
|
||||
pub fn password(&self) -> Option<&Cow<'static, str>> {
|
||||
self.0.password()
|
||||
pub fn password(&self) -> Option<&str> {
|
||||
self.0.password().map(|s| s.as_ref())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user