mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Moved mac vendor database to be compiled in the binary
This commit is contained in:
@@ -2,7 +2,6 @@ use lazy_static::lazy_static;
|
||||
use log::{debug, error, info};
|
||||
use serde::Deserialize;
|
||||
use std::collections::HashMap;
|
||||
use std::fs;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
@@ -20,17 +19,7 @@ lazy_static! {
|
||||
info!("Loading MAC vendor database into memory");
|
||||
|
||||
let mut database = HashMap::new();
|
||||
let data = match fs::read_to_string("data/mac-vendors-export.json") {
|
||||
Ok(value) => value,
|
||||
Err(error) => {
|
||||
error!(
|
||||
"Error reading mac vendors database (data/mac-vendors-export.json): {error}"
|
||||
);
|
||||
panic!(
|
||||
"Error reading mac vendors database (data/mac-vendors-export.json): {error}"
|
||||
);
|
||||
}
|
||||
};
|
||||
let data = include_str!("../data/mac-vendors-export.json");
|
||||
|
||||
let json: Vec<MacRecord> = match serde_json::from_str(&data) {
|
||||
Ok(value) => value,
|
||||
|
||||
Reference in New Issue
Block a user