From f959d0ad879dcaa63dc96123f5b5b1c9ed23aa00 Mon Sep 17 00:00:00 2001 From: Racer Engineer Date: Thu, 27 Nov 2025 09:10:24 -0800 Subject: [PATCH] Replace regex Captures::get(0).unwrap() with get_match() Differential Revision: D87978773 --- torch-sys/src/device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torch-sys/src/device.rs b/torch-sys/src/device.rs index 26dfc46d2..e682bc146 100644 --- a/torch-sys/src/device.rs +++ b/torch-sys/src/device.rs @@ -305,7 +305,7 @@ impl TryFrom<&str> for Device { .captures(val) .ok_or_else(|| DeviceParseError::ParserFailure(val.to_string()))?; - if captures.get(0).unwrap().len() != val.len() { + if captures.get_match().len() != val.len() { return Err(DeviceParseError::ParserFailure(val.to_string())); }