Fix build warning

This commit is contained in:
Austen Adler 2023-09-12 23:01:24 -04:00
parent d939c9481b
commit 9f00cb94da

View File

@ -1,7 +1,7 @@
// use kakplugin::Selection; // use kakplugin::Selection;
use regex::Regex; use regex::Regex;
use std::{ use std::{
borrow::{Borrow, Cow}, borrow::Cow,
collections::hash_map::DefaultHasher, collections::hash_map::DefaultHasher,
hash::{Hash, Hasher}, hash::{Hash, Hasher},
}; };
@ -33,7 +33,7 @@ pub fn get_key<'sel>(
// If they requested a regex match, set the key to the string slice of that match // If they requested a regex match, set the key to the string slice of that match
if let Some(regex_match) = (|| { if let Some(regex_match) = (|| {
// let captures = regex.as_ref()?.captures(&key)?; // let captures = regex.as_ref()?.captures(&key)?;
let captures = regex.as_ref()?.captures(key.borrow())?; let captures = regex.as_ref()?.captures(key)?;
captures captures
.get(1) .get(1)
.or_else(|| captures.get(0)) .or_else(|| captures.get(0))