mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
[fp-rs] Making some values const rather than static or inlined.
This commit is contained in:
@@ -124,6 +124,8 @@ fn init_cache() {
|
||||
|
||||
/// Sets up initial constructs and infinitely polls for advertisements.
|
||||
pub fn init() {
|
||||
const JSON_PATH: &str = "./local";
|
||||
|
||||
let run = async {
|
||||
info!("start making adapter");
|
||||
|
||||
@@ -134,7 +136,7 @@ pub fn init() {
|
||||
|
||||
let mut latest_advertisement_map = HashMap::new();
|
||||
let datatype_selector = vec![BleDataTypeId::ServiceData16BitUuid];
|
||||
let fetcher: Box<dyn FpFetcher> = Box::new(FpFetcherFs::new(String::from("./local")));
|
||||
let fetcher: Box<dyn FpFetcher> = Box::new(FpFetcherFs::new(String::from(JSON_PATH)));
|
||||
|
||||
loop {
|
||||
// Retrieve the next received advertisement.
|
||||
|
||||
@@ -28,7 +28,7 @@ impl FpDecoder {
|
||||
pub(crate) fn get_model_id_from_service_data<U: Copy>(
|
||||
service_data: &ServiceData<U>,
|
||||
) -> Result<Vec<u8>, FpError> {
|
||||
static MIN_MODEL_ID_LENGTH: usize = 3;
|
||||
const MIN_MODEL_ID_LENGTH: usize = 3;
|
||||
let data = service_data.data();
|
||||
|
||||
if data.len() < MIN_MODEL_ID_LENGTH {
|
||||
|
||||
Reference in New Issue
Block a user