Skip to content

Commit e2bce9a

Browse files
committed
tmp
1 parent 4e7299a commit e2bce9a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adb_client/src/server/models/device_short.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ use std::{fmt::Display, str::FromStr, sync::LazyLock};
33

44
use crate::{DeviceState, RustADBError};
55

6-
static DEVICES_REGEX: LazyLock<Regex> =
7-
LazyLock::new(|| Regex::new("^(\\S+)\t(\\w+)\n?$").expect("Cannot build devices regex"));
8-
96
/// Represents a device connected to the ADB server.
107
#[derive(Debug, Clone)]
118
pub struct DeviceShort {
@@ -25,6 +22,10 @@ impl TryFrom<Vec<u8>> for DeviceShort {
2522
type Error = RustADBError;
2623

2724
fn try_from(value: Vec<u8>) -> Result<Self, Self::Error> {
25+
static DEVICES_REGEX: LazyLock<Regex> = LazyLock::new(|| {
26+
Regex::new("^(\\S+)\t(\\w+)\n?$").expect("Cannot build devices regex")
27+
});
28+
2829
// Optional final '\n' is used to match TrackDevices inputs
2930
let groups = DEVICES_REGEX
3031
.captures(&value)

0 commit comments

Comments
 (0)