Home
last modified time | relevance | path

Searched refs:from_str (Results 1 – 25 of 125) sorted by relevance

12345

/external/rust/crates/macaddr/src/parser/
Dtests.rs13 let addr = MacAddr6::from_str("12-34-56-78-9A-BC"); in test_parse_v6_upper_case_canonical_format()
23 let addr = MacAddr6::from_str("ab-cd-ef-ab-cd-ef"); in test_parse_v6_lower_case_canonical_format()
33 let addr = MacAddr6::from_str("AB-cd-Ef-Ab-cD-EF"); in test_parse_v6_mixed_case_canonical_format()
43 let addr = MacAddr6::from_str("12:34:56:78:9A:BC"); in test_parse_v6_colon_format()
53 let addr = MacAddr6::from_str("1234.5678.9ABC"); in test_parse_v6_cisco_format()
63 let addr = MacAddr8::from_str("12-34-56-78-9A-BC-DE-F0"); in test_parse_v8_canonical_format()
73 let addr = MacAddr8::from_str("12:34:56:78:9A:BC:DE:F0"); in test_parse_v8_colon_format()
83 let addr = MacAddr::from_str("12-34-56-78-9A-BC-DE-F0"); in test_parse_canonical_format()
93 let addr = MacAddr::from_str("12:34:56:78:9A:BC:DE:F0"); in test_parse_colon_format()
103 let addr = MacAddr6::from_str(""); in test_parse_v6_empty()
[all …]
/external/rust/crates/chrono/src/naive/
Ddatetime.rs1472 fn from_str(s: &str) -> ParseResult<NaiveDateTime> { in from_str() method
1535 fn test_decodable_json<F, E>(from_str: F) in test_decodable_json()
1543 from_str(r#""2016-07-08T09:10:48.090""#).ok(), in test_decodable_json()
1547 from_str(r#""2016-7-8T9:10:48.09""#).ok(), in test_decodable_json()
1551 from_str(r#""2014-07-24T12:34:06""#).ok(), in test_decodable_json()
1555 from_str(r#""0000-01-01T00:00:60""#).ok(), in test_decodable_json()
1559 from_str(r#""0-1-1T0:0:60""#).ok(), in test_decodable_json()
1563 from_str(r#""-0001-12-31T23:59:59.000000007""#).ok(), in test_decodable_json()
1566 assert_eq!(from_str(r#""-262144-01-01T00:00:00""#).ok(), Some(MIN_DATE.and_hms(0, 0, 0))); in test_decodable_json()
1568 from_str(r#""+262143-12-31T23:59:60.999999999""#).ok(), in test_decodable_json()
[all …]
Dtime.rs1325 fn from_str(s: &str) -> ParseResult<NaiveTime> { in from_str() method
1376 fn test_decodable_json<F, E>(from_str: F) in test_decodable_json()
1381 assert_eq!(from_str(r#""00:00:00""#).ok(), Some(NaiveTime::from_hms(0, 0, 0))); in test_decodable_json()
1382 assert_eq!(from_str(r#""0:0:0""#).ok(), Some(NaiveTime::from_hms(0, 0, 0))); in test_decodable_json()
1383 assert_eq!(from_str(r#""00:00:00.950""#).ok(), Some(NaiveTime::from_hms_milli(0, 0, 0, 950))); in test_decodable_json()
1384 assert_eq!(from_str(r#""0:0:0.95""#).ok(), Some(NaiveTime::from_hms_milli(0, 0, 0, 950))); in test_decodable_json()
1385 assert_eq!(from_str(r#""00:00:60""#).ok(), Some(NaiveTime::from_hms_milli(0, 0, 59, 1_000))); in test_decodable_json()
1386 assert_eq!(from_str(r#""00:01:02""#).ok(), Some(NaiveTime::from_hms(0, 1, 2))); in test_decodable_json()
1388 from_str(r#""03:05:07.098765432""#).ok(), in test_decodable_json()
1391 assert_eq!(from_str(r#""07:08:09""#).ok(), Some(NaiveTime::from_hms(7, 8, 9))); in test_decodable_json()
[all …]
Ddate.rs1699 fn from_str(s: &str) -> ParseResult<NaiveDate> { in from_str() method
1731 fn test_decodable_json<F, E>(from_str: F) in test_decodable_json()
1738 assert_eq!(from_str(r#""2016-07-08""#).ok(), Some(NaiveDate::from_ymd(2016, 7, 8))); in test_decodable_json()
1739 assert_eq!(from_str(r#""2016-7-8""#).ok(), Some(NaiveDate::from_ymd(2016, 7, 8))); in test_decodable_json()
1740 assert_eq!(from_str(r#""+002016-07-08""#).ok(), Some(NaiveDate::from_ymd(2016, 7, 8))); in test_decodable_json()
1741 assert_eq!(from_str(r#""0000-01-01""#).ok(), Some(NaiveDate::from_ymd(0, 1, 1))); in test_decodable_json()
1742 assert_eq!(from_str(r#""0-1-1""#).ok(), Some(NaiveDate::from_ymd(0, 1, 1))); in test_decodable_json()
1743 assert_eq!(from_str(r#""-0001-12-31""#).ok(), Some(NaiveDate::from_ymd(-1, 12, 31))); in test_decodable_json()
1744 assert_eq!(from_str(r#""-262144-01-01""#).ok(), Some(MIN_DATE)); in test_decodable_json()
1745 assert_eq!(from_str(r#""+262143-12-31""#).ok(), Some(MAX_DATE)); in test_decodable_json()
[all …]
/external/rust/crates/log/src/kv/
Dkey.rs31 Key::from_str(self) in to_key()
43 pub fn from_str(key: &'k str) -> Self { in from_str() method
108 Key::from_str(s) in from()
120 Key::from_str(self) in to_key()
126 Key::from_str(self) in to_key()
170 assert_eq!("a key", Key::from_str("a key").as_str()); in key_from_string()
Dsource.rs346 Source::get(&source, Key::from_str("a")).unwrap().to_token() in get()
350 assert!(Source::get(&source, Key::from_str("a")).is_none()); in get()
362 Source::get(&map, Key::from_str("a")).unwrap().to_token() in hash_map()
375 Source::get(&map, Key::from_str("a")).unwrap().to_token() in btree_map()
731 Source::get(source, Key::from_str("a")).unwrap().to_token() in get()
735 Source::get(source, Key::from_str("b")).unwrap().to_token() in get()
737 assert!(Source::get(&source, Key::from_str("c")).is_none()); in get()
740 assert!(Source::get(&source, Key::from_str("a")).is_none()); in get()
/external/rust/crates/structopt/tests/
Dspecial_types.rs16 fn from_str(s: &str) -> Result<Self, Self::Err> { in special_types_bool() method
43 #[structopt(parse(from_str = parser))] in special_types_option()
63 #[structopt(parse(from_str = parser))] in special_types_vec()
/external/rust/crates/rusqlite/src/util/
Dsqlite_string.rs105 pub(crate) fn from_str(s: &str) -> Self { in from_str() method
191 let s = SqliteMallocString::from_str(input); in test_from_str()
200 let p = SqliteMallocString::from_str("abcd").into_raw(); in test_lossy()
214 v.push(SqliteMallocString::from_str(&i.to_string()).into_raw()); in test_into_raw()
215 v.push(SqliteMallocString::from_str(&format!("abc {} ��", i)).into_raw()); in test_into_raw()
/external/rust/crates/structopt/tests/ui/
Dparse_not_zero_args.stderr4 14 | #[structopt(parse(from_str, from_str))]
Dparse_not_zero_args.rs14 #[structopt(parse(from_str, from_str))]
Dparse_literal_spec.stderr4 14 | #[structopt(parse("from_str"))]
Dparse_function_is_not_path.stderr4 14 | #[structopt(parse(from_str = "2"))]
Dstruct_parse.stderr4 12 | #[structopt(name = "basic", parse(from_str))]
Dparse_function_is_not_path.rs14 #[structopt(parse(from_str = "2"))]
Dstruct_parse.rs12 #[structopt(name = "basic", parse(from_str))]
/external/llvm-project/lldb/unittests/Utility/
DUUIDTest.cpp44 UUID from_str; in TEST() local
45 from_str.SetFromStringRef("00000000-0000-0000-0000-000000000000"); in TEST()
52 EXPECT_TRUE(from_str); in TEST()
/external/rust/crates/once_cell/examples/
Dregex.rs21 let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap(); in slow()
35 let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap(); in fast()
/external/python/cpython3/Tools/stringbench/
Dstringbench.py1215 from_str = STR(" ")
1219 s_replace(from_str, to_str)
1236 from_str = STR("\n")
1240 s_replace(from_str, to_str)
1258 from_str = STR("ATC")
1262 seq_replace(from_str, to_str)
1269 from_str = STR("\n")
1273 s_replace(from_str, to_str)
1281 from_str = STR("ee")
1285 s_replace(from_str, to_str)
[all …]
/external/rust/crates/bindgen/src/codegen/
Dhelpers.rs23 .map(|one| TokenStream::from_str(one).expect("repr to be valid")); in repr_list()
60 TokenStream::from_str(&comment).unwrap() in doc()
143 let prefix = TokenStream::from_str(prefix.as_str()).unwrap(); in c_void()
164 let prefix = TokenStream::from_str(prefix.as_str()).unwrap(); in raw_type()
/external/rust/cxx/syntax/
Datom.rs27 Self::from_str(ident.to_string().as_str()) in from()
30 pub fn from_str(s: &str) -> Option<Self> { in from_str() method
/external/rust/crates/cexpr/tests/
Dclang.rs33 .and_then(|v| i64::from_str(&v).ok()) in test_definition()
81 .and_then(|v| f64::from_str(&v).ok()) in test_definition()
86 .and_then(|v| u64::from_str(v).ok()) in test_definition()
92 .and_then(|v| u32::from_str(v).ok()) in test_definition()
/external/tensorflow/tensorflow/python/autograph/pyct/
Dast_util_test.py57 node, {qual_names.from_str('b.c'): qual_names.QN('renamed_b_c')})
67 node, {qual_names.from_str('b'): qual_names.QN('renamed_b')})
77 node, {qual_names.from_str('b'): qual_names.QN('renamed_b')})
/external/llvm-project/clang/utils/analyzer/
DProjectMap.py50 def from_str(raw_size: Optional[str]) -> "Size": member in Size
160 size = Size.from_str(raw_project.get("size", None))
/external/rust/crates/bindgen/src/
Dfeatures.rs44 fn from_str(s: &str) -> Result<Self, Self::Err> {
277 assert_eq!(target, RustTarget::from_str(target_str).unwrap()); in test_target()
/external/rust/crates/syn/benches/
Dfile.rs28 let tokens = TokenStream::from_str(&content).unwrap(); in parse_file()

12345