From 73a7d79023e5b9bf02dde2c4b972931948b8b9c4 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Fri, 25 Apr 2025 10:48:19 +0200 Subject: [PATCH] Remove dead code in color parsing --- src/text_face.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/text_face.rs b/src/text_face.rs index e4e15f31b..433bc6cbe 100644 --- a/src/text_face.rs +++ b/src/text_face.rs @@ -228,9 +228,8 @@ pub(crate) fn parse_text_face_and_options<'a>( underline_color = w.woptarg; } 'h' => { - if is_builtin { - return TextFaceArgsAndOptionsResult::PrintHelp; - } + assert!(is_builtin); + return TextFaceArgsAndOptionsResult::PrintHelp; } 'o' => style.bold = true, 'i' => style.italics = true, @@ -246,7 +245,10 @@ pub(crate) fn parse_text_face_and_options<'a>( return TextFaceArgsAndOptionsResult::InvalidUnderlineStyle(arg); } } - 'c' => print_color_mode = true, + 'c' => { + assert!(is_builtin); + print_color_mode = true; + } ':' => { if is_builtin { return TextFaceArgsAndOptionsResult::InvalidArgs;