pub fn with_encoded_name(name: std::borrow::Cow<'_, str>) -> Self {
        match name.is_ascii() {
            true => Self::with_name(name.into_owned()),
            false => match utf8_percent_encode(&name, HEADER_VALUE_ENCODE_SET).into() {
                std::borrow::Cow::Owned(encoded) => Self::with_extended(None, encoded),
                std::borrow::Cow::Borrowed(maybe_encoded) => match maybe_encoded == name {
                    true => Self::with_extended(None, maybe_encoded.to_owned()),
                    false => Self::with_name(name.into_owned()),
                }
            }
        }
    }
///Creates file name, and checks whether it should be encoded.
///
///Note that actual encoding would happen only when header is written.
///The value itself would remain unchanged in the `Filename`.
Creates file name, and checks whether it should be encoded.
Note that actual encoding would happen only when header is written.
The value itself would remain unchanged in the `Filename`.
Creates file name and checks whether it should be encoded . Note that actual encoding would happen only when header is written . The value itself would remain unchanged in the ` Filename ` .
pub fn with_encoded_name(name: std::borrow::Cow<'_, str>) -> Self {
        match name.is_ascii() {
            true => Self::with_name(name.into_owned()),
            false => match utf8_percent_encode(&name, HEADER_VALUE_ENCODE_SET).into() {
                std::borrow::Cow::Owned(encoded) => Self::with_extended(None, encoded),
                std::borrow::Cow::Borrowed(maybe_encoded) => match maybe_encoded == name {
                    true => Self::with_extended(None, maybe_encoded.to_owned()),
                    false => Self::with_name(name.into_owned()),
                }
            }
        }
    }
pub fn with_encoded_name ( name : std :: borrow :: Cow < ' _ , str > ) -> Self { match name . is_ascii ( ) { true => Self :: with_name ( name . into_owned ( ) ) , false => match utf8_percent_encode ( & name , HEADER_VALUE_ENCODE_SET ) . into ( ) { std :: borrow :: Cow :: Owned ( encoded ) => Self :: with_extended ( None , encoded ) , std :: borrow :: Cow :: Borrowed ( maybe_encoded ) => match maybe_encoded == name { true => Self :: with_extended ( None , maybe_encoded . to_owned ( ) ) , false => Self :: with_name ( name . into_owned ( ) ) , } } } }
Creates file name, and checks whether it should be encoded.
Creates file name and checks whether it should be encoded .
name
std::borrow::Cow<'_, str>