@@ -71,7 +71,6 @@ impl<'a> From<Vec<(&'a str, &'a str)>> for MenuentryBody<'a> {
7171
7272/// A complete GRUB menuentry with title and body commands.
7373#[ derive( Debug , PartialEq , Eq ) ]
74- #[ allow( dead_code) ]
7574pub ( crate ) struct MenuEntry < ' a > {
7675 /// Display title (supports escaped quotes)
7776 pub ( crate ) title : & ' a str ,
@@ -88,8 +87,7 @@ impl<'a> Display for MenuEntry<'a> {
8887}
8988
9089/// Parser that takes content until balanced brackets, handling nested brackets and escapes.
91- #[ allow( dead_code) ]
92- pub fn take_until_balanced_allow_nested (
90+ fn take_until_balanced_allow_nested (
9391 opening_bracket : char ,
9492 closing_bracket : char ,
9593) -> impl Fn ( & str ) -> IResult < & str , & str > {
@@ -141,7 +139,6 @@ pub fn take_until_balanced_allow_nested(
141139}
142140
143141/// Parses a single menuentry with title and body commands.
144- #[ allow( dead_code) ]
145142fn parse_menuentry ( input : & str ) -> IResult < & str , MenuEntry < ' _ > > {
146143 let ( input, _) = tag ( "menuentry" ) . parse ( input) ?;
147144
@@ -190,14 +187,12 @@ fn parse_menuentry(input: &str) -> IResult<&str, MenuEntry<'_>> {
190187}
191188
192189/// Skips content until finding "menuentry" keyword or end of input.
193- #[ allow( dead_code) ]
194190fn skip_to_menuentry ( input : & str ) -> IResult < & str , ( ) > {
195191 let ( input, _) = take_until ( "menuentry" ) ( input) ?;
196192 Ok ( ( input, ( ) ) )
197193}
198194
199195/// Parses all menuentries from a GRUB configuration file.
200- #[ allow( dead_code) ]
201196fn parse_all ( input : & str ) -> IResult < & str , Vec < MenuEntry < ' _ > > > {
202197 let mut remaining = input;
203198 let mut entries = Vec :: new ( ) ;
@@ -229,7 +224,6 @@ fn parse_all(input: &str) -> IResult<&str, Vec<MenuEntry<'_>>> {
229224}
230225
231226/// Main entry point for parsing GRUB menuentry files.
232- #[ allow( dead_code) ]
233227pub ( crate ) fn parse_grub_menuentry_file ( contents : & str ) -> anyhow:: Result < Vec < MenuEntry < ' _ > > > {
234228 let ( _, entries) = parse_all ( & contents)
235229 . map_err ( |e| anyhow:: anyhow!( "Failed to parse GRUB menuentries: {e}" ) ) ?;
0 commit comments