Skip to content

Commit 1ad9fb6

Browse files
TatriXMartinKavik
authored andcommitted
feat(fetch): Change bearer type to Into<Cow>
So user can use String and to mirror other header methods signatures.
1 parent 5bf947e commit 1ad9fb6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/browser/fetch/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ impl<'a> Header<'a> {
4949
}
5050

5151
/// Create `Authorization: Bearer xxx` header.
52-
pub fn bearer(token: &str) -> Header<'a> {
53-
Self::custom("Authorization", format!("Bearer {}", token))
52+
pub fn bearer(token: impl Into<Cow<'a, str>>) -> Header<'a> {
53+
Self::custom("Authorization", format!("Bearer {}", token.into()))
5454
}
5555

5656
/// Create custom header.

0 commit comments

Comments
 (0)