From 8c46a255f9987f06fb4f60d9c576d8694dbc80d5 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 14 Jul 2026 18:24:38 +0800 Subject: feat(style): fall back to UNIX_STYLE when global style unset --- mingling_picker/src/parselib/style.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/mingling_picker/src/parselib/style.rs b/mingling_picker/src/parselib/style.rs index c0eb58f..770ef05 100644 --- a/mingling_picker/src/parselib/style.rs +++ b/mingling_picker/src/parselib/style.rs @@ -75,12 +75,8 @@ impl<'a> ParserStyle<'a> { } } - /// Returns the global parser style, or `None` if not yet set. - pub fn global_style() -> Option<&'static ParserStyle<'static>> { - if GLOBAL_STYLE_SET.load(Ordering::Acquire) { - GLOBAL_STYLE.get() - } else { - None - } + /// Returns the global parser style, falling back to `UNIX_STYLE` if not set. + pub fn global_style() -> &'static ParserStyle<'static> { + GLOBAL_STYLE.get().unwrap_or(&UNIX_STYLE) } } -- cgit