(buf: &[u8], n: i32)
| 1405 | #[no_mangle] |
| 1406 | pub extern "C" fn bloom_get_language() -> f64 { |
| 1407 | fn parse(buf: &[u8], n: i32) -> Option<f64> { |
| 1408 | if n < 2 { return None; } |
| 1409 | let lc = |b: u8| if b.is_ascii_uppercase() { b + 32 } else { b }; |
| 1410 | let (c0, c1) = (lc(buf[0]), lc(buf[1])); |
| 1411 | if c0.is_ascii_alphabetic() && c1.is_ascii_alphabetic() { |
| 1412 | Some((c0 as f64) * 256.0 + (c1 as f64)) |
| 1413 | } else { |
| 1414 | None |
| 1415 | } |
| 1416 | } |
| 1417 | let props: [&[u8]; 3] = [ |
| 1418 | b"persist.sys.locale\0", |
| 1419 | b"ro.product.locale\0", |
no outgoing calls
no test coverage detected