mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-02-21 17:26:37 +00:00
Remove old commented-out code.
This commit is contained in:
parent
0fc548d6b4
commit
b0e61b50d2
@ -95,46 +95,6 @@ pub async fn struct_to_binary(
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
pub fn get_data_keys(s: &pbjson_types::Struct) -> Vec<String> {
|
||||
let mut out: Vec<String> = Vec::new();
|
||||
|
||||
for (k, v) in &s.fields {
|
||||
out.extend_from_slice(&_get_data_keys(k, v));
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
fn _get_data_keys(prefix: &str, v: &pbjson_types::Value) -> Vec<String> {
|
||||
match &v.kind {
|
||||
None => vec![prefix.to_string()],
|
||||
Some(v) => match v {
|
||||
pbjson_types::value::Kind::NullValue(_)
|
||||
| pbjson_types::value::Kind::NumberValue(_)
|
||||
| pbjson_types::value::Kind::StringValue(_)
|
||||
| pbjson_types::value::Kind::BoolValue(_) => {
|
||||
vec![prefix.to_string()]
|
||||
}
|
||||
pbjson_types::value::Kind::StructValue(v) => {
|
||||
let mut out: Vec<String> = Vec::new();
|
||||
for (k, v) in &v.fields {
|
||||
out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, k), v));
|
||||
}
|
||||
out
|
||||
}
|
||||
pbjson_types::value::Kind::ListValue(v) => {
|
||||
let mut out: Vec<String> = Vec::new();
|
||||
for (i, v) in v.values.iter().enumerate() {
|
||||
out.extend_from_slice(&_get_data_keys(&format!("{}_{}", prefix, i), v));
|
||||
}
|
||||
out
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
pub fn get_measurements(s: &pbjson_types::Struct) -> HashMap<String, pbjson_types::value::Kind> {
|
||||
let mut out: HashMap<String, pbjson_types::value::Kind> = HashMap::new();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user