Home
last modified time | relevance | path

Searched refs:Cow (Results 1 – 25 of 80) sorted by relevance

1234

/external/rust/crates/criterion-plot/src/
Ddisplay.rs1 use std::borrow::Cow;
28 impl Display<Cow<'static, str>> for Color {
29 fn display(&self) -> Cow<'static, str> { in display()
31 Color::Black => Cow::from("black"), in display()
32 Color::Blue => Cow::from("blue"), in display()
33 Color::Cyan => Cow::from("cyan"), in display()
34 Color::DarkViolet => Cow::from("dark-violet"), in display()
35 Color::ForestGreen => Cow::from("forest-green"), in display()
36 Color::Gold => Cow::from("gold"), in display()
37 Color::Gray => Cow::from("gray"), in display()
[all …]
Dproxy.rs6 use std::borrow::Cow;
14 S: Into<Cow<'static, str>>, in Font()
24 S: Into<Cow<'static, str>>, in Label()
34 S: Into<Cow<'static, str>>, in Title()
44 P: Into<Cow<'static, Path>>, in Output()
Dlib.rs378 use std::borrow::Cow;
411 font: Option<Cow<'static, str>>,
414 output: Cow<'static, Path>,
419 title: Option<Cow<'static, str>>,
432 output: Cow::Borrowed(Path::new("output.plot")), in new()
697 pub struct Font(Cow<'static, str>);
708 pub struct Label(Cow<'static, str>);
719 pub struct Output(Cow<'static, Path>);
747 pub struct Title(Cow<'static, str>);
/external/rust/crates/grpcio/src/
Dchannel.rs3 use std::borrow::Cow;
75 options: HashMap<Cow<'static, [u8]>, Options>,
91 Cow::Borrowed(grpcio_sys::GRPC_ARG_DEFAULT_AUTHORITY), in default_authority()
101 Cow::Borrowed(grpcio_sys::GRPC_ARG_RESOURCE_QUOTA), in set_resource_quota()
111 Cow::Borrowed(grpcio_sys::GRPC_ARG_MAX_CONCURRENT_STREAMS), in max_concurrent_stream()
120 Cow::Borrowed(grpcio_sys::GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH), in max_receive_message_len()
129 Cow::Borrowed(grpcio_sys::GRPC_ARG_MAX_SEND_MESSAGE_LENGTH), in max_send_message_len()
138 Cow::Borrowed(grpcio_sys::GRPC_ARG_MAX_RECONNECT_BACKOFF_MS), in max_reconnect_backoff()
147 Cow::Borrowed(grpcio_sys::GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS), in initial_reconnect_backoff()
156 Cow::Borrowed(grpcio_sys::GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER), in https_initial_seq_number()
[all …]
Dmetadata.rs4 use std::borrow::Cow;
10 fn normalize_key(key: &str, binary: bool) -> Result<Cow<'_, str>> { in normalize_key()
33 Cow::Owned(key.to_ascii_lowercase()) in normalize_key()
35 Cow::Borrowed(key) in normalize_key()
/external/rust/crates/form_urlencoded/src/
Dlib.rs20 use std::borrow::{Borrow, Cow};
41 type Item = (Cow<'a, str>, Cow<'a, str>);
62 fn decode(input: &[u8]) -> Cow<'_, str> { in decode()
65 Cow::Owned(vec) => Cow::Owned(vec), in decode()
66 Cow::Borrowed(_) => replaced, in decode()
71 fn replace_plus(input: &[u8]) -> Cow<'_, [u8]> { in replace_plus()
73 None => Cow::Borrowed(input), in replace_plus()
82 Cow::Owned(replaced) in replace_plus()
384 pub(crate) fn encode<'a>(encoding_override: EncodingOverride<'_>, input: &'a str) -> Cow<'a, [u8]> { in encode()
391 pub(crate) fn decode_utf8_lossy(input: Cow<'_, [u8]>) -> Cow<'_, str> { in decode_utf8_lossy()
[all …]
/external/rust/crates/bstr/src/
Dcow.rs3 use std::borrow::Cow;
16 struct Imp<'a>(Cow<'a, [u8]>);
39 CowBytes(Imp(Cow::Owned(bytes))) in new_owned()
55 Cow::Borrowed(b) => CowBytes::new_owned(b.to_vec()), in into_owned()
56 Cow::Owned(b) => CowBytes::new_owned(b), in into_owned()
64 Imp(Cow::Borrowed(bytes)) in new()
75 Cow::Owned(ref x) => x, in as_slice()
76 Cow::Borrowed(x) => x, in as_slice()
Dext_vec.rs3 use std::borrow::Cow;
215 fn from_os_str_lossy<'a>(os_str: &'a OsStr) -> Cow<'a, [u8]> { in from_os_str_lossy()
218 fn imp<'a>(os_str: &'a OsStr) -> Cow<'a, [u8]> { in from_os_str_lossy()
221 Cow::Borrowed(os_str.as_bytes()) in from_os_str_lossy()
226 fn imp<'a>(os_str: &'a OsStr) -> Cow<'a, [u8]> { in from_os_str_lossy()
228 Cow::Borrowed(x) => Cow::Borrowed(x.as_bytes()), in from_os_str_lossy()
229 Cow::Owned(x) => Cow::Owned(Vec::from(x)), in from_os_str_lossy()
280 fn from_path_lossy<'a>(path: &'a Path) -> Cow<'a, [u8]> { in from_path_lossy()
429 Cow::Borrowed(_) => { in into_string_lossy()
434 Cow::Owned(s) => s, in into_string_lossy()
Dext_slice.rs2 use std::borrow::Cow;
347 fn to_str_lossy(&self) -> Cow<str> { in to_str_lossy()
353 Cow::Borrowed(str::from_utf8_unchecked(self.as_bytes())) in to_str_lossy()
367 Cow::Owned(lossy) in to_str_lossy()
491 fn to_os_str_lossy(&self) -> Cow<OsStr> { in to_os_str_lossy()
494 fn imp(bytes: &[u8]) -> Cow<OsStr> { in to_os_str_lossy()
497 Cow::Borrowed(OsStr::from_bytes(bytes)) in to_os_str_lossy()
502 fn imp(bytes: &[u8]) -> Cow<OsStr> { in to_os_str_lossy()
506 Cow::Borrowed(x) => Cow::Borrowed(OsStr::new(x)), in to_os_str_lossy()
507 Cow::Owned(x) => Cow::Owned(OsString::from(x)), in to_os_str_lossy()
[all …]
Dimpls.rs64 use std::borrow::{Borrow, Cow, ToOwned};
196 impl<'a> From<BString> for Cow<'a, BStr> { implementation
198 fn from(s: BString) -> Cow<'a, BStr> { in from()
199 Cow::Owned(s) in from()
305 use std::borrow::Cow;
598 impl<'a> From<&'a BStr> for Cow<'a, BStr> { implementation
600 fn from(s: &'a BStr) -> Cow<'a, BStr> { in from()
601 Cow::Borrowed(s) in from()
644 impl_partial_eq_cow!(&'a BStr, Cow<'a, BStr>);
646 impl_partial_eq_cow!(&'a BStr, Cow<'a, str>);
[all …]
/external/rust/crates/percent-encoding/
Dlib.rs40 use std::borrow::Cow;
290 impl<'a> From<PercentEncode<'a>> for Cow<'a, str> { implementation
375 impl<'a> From<PercentDecode<'a>> for Cow<'a, [u8]> { implementation
378 Some(vec) => Cow::Owned(vec), in from()
379 None => Cow::Borrowed(iter.bytes.as_slice()), in from()
405 pub fn decode_utf8(self) -> Result<Cow<'a, str>, str::Utf8Error> { in decode_utf8()
407 Cow::Borrowed(bytes) => match str::from_utf8(bytes) { in decode_utf8()
411 Cow::Owned(bytes) => match String::from_utf8(bytes) { in decode_utf8()
422 pub fn decode_utf8_lossy(self) -> Cow<'a, str> { in decode_utf8_lossy()
427 fn decode_utf8_lossy(input: Cow<[u8]>) -> Cow<str> { in decode_utf8_lossy()
[all …]
/external/rust/crates/regex/tests/
Dreplace.rs155 t!(std::borrow::Cow::<'_, str>::Borrowed("Z")),
163 t!(&std::borrow::Cow::<'_, str>::Borrowed("Z")),
171 t!(std::borrow::Cow::<'_, str>::Owned("Z".to_string())),
179 t!(&std::borrow::Cow::<'_, str>::Owned("Z".to_string())),
204 bytes!(std::borrow::Cow::<'_, [u8]>::Borrowed(&[b'Z'])),
212 bytes!(&std::borrow::Cow::<'_, [u8]>::Borrowed(&[b'Z'])),
220 bytes!(std::borrow::Cow::<'_, [u8]>::Owned(vec![b'Z'])),
228 bytes!(&std::borrow::Cow::<'_, [u8]>::Owned(vec![b'Z'])),
/external/rust/crates/libloading/src/
Dutil.rs2 use std::borrow::Cow;
10 pub(crate) fn cstr_cow_from_bytes(slice: &[u8]) -> Result<Cow<'_, CStr>, Error> { in cstr_cow_from_bytes()
14 None => unsafe { Cow::Borrowed(CStr::from_ptr(&ZERO)) }, in cstr_cow_from_bytes()
16 Some(&0) => Cow::Borrowed(CStr::from_bytes_with_nul(slice) in cstr_cow_from_bytes()
19 Some(_) => Cow::Owned(CString::new(slice) in cstr_cow_from_bytes()
/external/rust/crates/env_logger/src/
Dlib.rs281 use std::{borrow::Cow, cell::RefCell, env, io};
318 name: Cow<'a, str>,
319 default: Option<Cow<'a, str>>,
967 E: Into<Cow<'a, str>>, in filter()
979 E: Into<Cow<'a, str>>, in filter_or()
980 V: Into<Cow<'a, str>>, in filter_or()
992 V: Into<Cow<'a, str>>, in default_filter_or()
1006 E: Into<Cow<'a, str>>, in write_style()
1018 E: Into<Cow<'a, str>>, in write_style_or()
1019 V: Into<Cow<'a, str>>, in write_style_or()
[all …]
/external/rust/crates/regex/src/
Dre_unicode.rs1 use std::borrow::Cow;
511 ) -> Cow<'t, str> { in replace()
525 ) -> Cow<'t, str> { in replace_all()
540 ) -> Cow<'t, str> { in replacen()
553 return Cow::Borrowed(text); in replacen()
566 return Cow::Owned(new); in replacen()
573 return Cow::Borrowed(text); in replacen()
588 Cow::Owned(new) in replacen()
1170 fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, str>> { in no_expansion()
1210 fn no_expansion(&mut self) -> Option<Cow<str>> { in no_expansion()
[all …]
Dre_bytes.rs1 use std::borrow::Cow;
461 ) -> Cow<'t, [u8]> { in replace()
475 ) -> Cow<'t, [u8]> { in replace_all()
490 ) -> Cow<'t, [u8]> { in replacen()
494 return Cow::Borrowed(text); in replacen()
507 return Cow::Owned(new); in replacen()
514 return Cow::Borrowed(text); in replacen()
529 Cow::Owned(new) in replacen()
1128 fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, [u8]>> { in no_expansion()
1168 fn no_expansion<'r>(&'r mut self) -> Option<Cow<'r, [u8]>> { in no_expansion()
[all …]
/external/rust/crates/codespan-reporting/tests/snapshots/
Dterm__unicode_spans__rich_no_color.snap15 │ -- Cow range does not start at boundary.
21 │ -- Cow range does not end at boundary.
27 │ ------ Cow does not start or end at boundary.
/external/rust/crates/rayon/src/iter/
Dfrom_par_iter.rs4 use std::borrow::Cow;
178 impl<'a> FromParallelIterator<Cow<'a, str>> for String {
181 I: IntoParallelIterator<Item = Cow<'a, str>>, in from_par_iter()
192 impl<'a, C: ?Sized, T> FromParallelIterator<T> for Cow<'a, C> implementation
202 Cow::Owned(C::Owned::from_par_iter(par_iter)) in from_par_iter()
/external/rust/crates/rusqlite/src/types/
Dto_sql.rs5 use std::borrow::Cow;
94 impl<T: ToSql + ToOwned + ?Sized> ToSql for Cow<'_, T> { implementation
225 use std::borrow::Cow; in test_cow_str()
227 let cow: Cow<str> = Cow::Borrowed(s); in test_cow_str()
230 let cow: Cow<str> = Cow::Owned::<str>(String::from(s)); in test_cow_str()
/external/rust/crates/quote/tests/
Dtest.rs3 use std::borrow::Cow;
89 let item_ty = quote!(Cow<'a, str>); in test_advanced()
328 let owned: Cow<Ident> = Cow::Owned(Ident::new("owned", Span::call_site())); in test_cow()
331 let borrowed = Cow::Borrowed(&ident); in test_cow()
366 let id5 = format_ident!("Hello{}", Cow::Borrowed("World")); in test_format_ident()
/external/rust/crates/clap/src/args/arg_builder/
Dpositional.rs2 use std::borrow::Cow;
78 pub fn name_no_brackets(&self) -> Cow<str> { in name_no_brackets()
89 Cow::Owned( in name_no_brackets()
97 Cow::Borrowed(names.values().next().expect(INTERNAL_ERROR_MSG)) in name_no_brackets()
101 Cow::Borrowed(self.b.name) in name_no_brackets()
/external/rust/crates/bencher/
Dmacros.rs9 use std::borrow::Cow;
14 name: Cow::from(stringify!($function)),
/external/rust/crates/env_logger/src/fmt/writer/termcolor/
Dextern_impl.rs1 use std::borrow::Cow;
232 style: Cow<'a, Style>,
367 style: Cow::Borrowed(self), in value()
375 style: Cow::Owned(self), in into_value()
/external/rust/crates/quote/src/
Dident_fragment.rs2 use std::borrow::Cow;
58 impl<T> IdentFragment for Cow<'_, T> implementation
/external/rust/crates/url/tests/
Dunit.rs11 use std::borrow::Cow;
340 let pairs: &[(Cow<'_, str>, Cow<'_, str>)] = &[ in test_form_urlencoded()
638 Some((Cow::Borrowed("page"), Cow::Borrowed("2"))) in test_query()
649 Some((Cow::Borrowed("country"), Cow::Borrowed("español"))) in test_query()
658 Some((Cow::Borrowed("page"), Cow::Borrowed("2"))) in test_query()
662 Some((Cow::Borrowed("sort"), Cow::Borrowed("desc"))) in test_query()

1234