feat(voice): add iOS VAD runtime support
This commit is contained in:
@@ -536,7 +536,7 @@ struct PttBanCheckVisitor {
|
||||
|
||||
impl PttBanCheckVisitor {
|
||||
fn check(&mut self, name: &str) {
|
||||
if !self.banned && PTT_BANNED_FIELDS.iter().any(|b| *b == name) {
|
||||
if !self.banned && PTT_BANNED_FIELDS.contains(&name) {
|
||||
self.banned = true;
|
||||
}
|
||||
}
|
||||
@@ -761,7 +761,6 @@ mod tests {
|
||||
v.check("key_code"); // banned
|
||||
assert!(v.banned);
|
||||
|
||||
let mut v2 = PttBanCheckVisitor::default();
|
||||
for name in [
|
||||
"scan_code",
|
||||
"virtual_key",
|
||||
@@ -772,7 +771,7 @@ mod tests {
|
||||
"key_press_history",
|
||||
"key_timing",
|
||||
] {
|
||||
v2 = PttBanCheckVisitor::default();
|
||||
let mut v2 = PttBanCheckVisitor::default();
|
||||
v2.check(name);
|
||||
assert!(v2.banned, "expected {name} to be banned");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user