Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ohkami/src/request/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const _: () = {
}

impl Path {
pub fn params(&self) -> impl Iterator<Item = Cow<str>> {
pub fn params(&self) -> impl Iterator<Item = Cow<'_, str>> {
unsafe {self.0.assume_init_ref()}
.params.iter()
.map(|slice| percent_decode_utf8(unsafe {slice.as_bytes()})
Expand All @@ -39,7 +39,7 @@ const _: () = {
/// Get request path as `Cow::Borrowed(&str)` if it's not percent-encoded, or,
/// decode it into `Cow::Owned(String)` if encoded in the original request.
#[inline]
pub fn str(&self) -> Cow<str> {
pub fn str(&self) -> Cow<'_, str> {
let bytes = unsafe {self.0.assume_init_ref().raw.as_bytes()};
if bytes.is_empty() {return Cow::Borrowed("/")}
percent_decode_utf8(bytes).expect("Non UTF-8 path params")
Expand Down
2 changes: 1 addition & 1 deletion ohkami/src/response/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ const _: () = {
impl Into<::worker::Headers> for Headers {
#[inline(always)]
fn into(self) -> ::worker::Headers {
let mut h = ::worker::Headers::new();
let h = ::worker::Headers::new();
for (k, v) in self.iter() {
if let Err(_e) = h.append(k, v) {
#[cfg(feature="DEBUG")] println!("`worker::Headers::append` failed: {_e:?}");
Expand Down
2 changes: 1 addition & 1 deletion ohkami_lib/src/serde_cookie/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub mod valid {
}

#[inline]
pub fn value(mut bytes: &[u8]) -> Result<std::borrow::Cow<str>, super::super::Error> {
pub fn value(mut bytes: &[u8]) -> Result<std::borrow::Cow<'_, str>, super::super::Error> {
use std::borrow::Cow;

if bytes.len() >= 2 && bytes[0] == b'"' && bytes[bytes.len() - 1] == b'"' {
Expand Down