From c25cc8df5d01e7d341ea313e6426322ca8b9c176 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 19 Apr 2023 10:30:28 +0200 Subject: [PATCH] Adopt rusty parse_util_unescape_wildcards --- fish-rust/src/ffi.rs | 2 -- fish-rust/src/flog.rs | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fish-rust/src/ffi.rs b/fish-rust/src/ffi.rs index f0a10fe72..2e3ddfad4 100644 --- a/fish-rust/src/ffi.rs +++ b/fish-rust/src/ffi.rs @@ -59,8 +59,6 @@ include_cpp! { generate!("log_extra_to_flog_file") generate!("indent_visitor_t") - generate!("parse_util_unescape_wildcards") - generate!("fish_wcwidth") generate!("fish_wcswidth") diff --git a/fish-rust/src/flog.rs b/fish-rust/src/flog.rs index 8d66dde2d..ca60c8f7b 100644 --- a/fish-rust/src/flog.rs +++ b/fish-rust/src/flog.rs @@ -1,4 +1,5 @@ -use crate::ffi::{get_flog_file_fd, parse_util_unescape_wildcards, wildcard_match}; +use crate::ffi::{get_flog_file_fd, wildcard_match}; +use crate::parse_util::parse_util_unescape_wildcards; use crate::wchar::{widestrs, wstr, WString}; use crate::wchar_ffi::WCharToFFI; use std::io::Write; @@ -208,10 +209,10 @@ pub(crate) use {should_flog, FLOG, FLOGF}; /// For each category, if its name matches the wildcard, set its enabled to the given sense. fn apply_one_wildcard(wc_esc: &wstr, sense: bool) { - let wc = parse_util_unescape_wildcards(&wc_esc.to_ffi()); + let wc = parse_util_unescape_wildcards(wc_esc); let mut match_found = false; for cat in categories::all_categories() { - if wildcard_match(&cat.name.to_ffi(), &wc, false) { + if wildcard_match(&cat.name.to_ffi(), &wc.to_ffi(), false) { cat.enabled.store(sense, Ordering::Relaxed); match_found = true; }