From 0c745edddca6eb3347486b7ce9c77b0bb3de54b1 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 26 Nov 2020 23:11:05 +0100 Subject: Don't shadow PAppVersion from cubase_project.rs. --- src/main.rs | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/main.rs b/src/main.rs index bf5c2d9..802d50e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -78,7 +78,7 @@ enum NodeValue<'a> { SignatureTrackEvent(MSignatureTrackEvent<'a>), TempoTrackEvent(&'a [u8]), - Version(PAppVersion<'a>), + Version(PAppVersion), } /// A vector of 32bit words preceeded by a 16 bit count. @@ -92,32 +92,19 @@ fn bytevec<'a>(data: &'a[u8]) -> IResult<&'a [u8], &'a [u8]> { length_data(be_u32)(&data) } -/// Version information about the app that created the file. -#[derive(Debug)] -struct PAppVersion<'a> { - appname: &'a str, - appversion: &'a str, - appdate: &'a str, - num2: u32, - apparch: &'a str, - num3: u32, - appencoding: &'a str, - applocale: &'a str, -} - -fn p_appversion<'a>(data: &'a [u8]) -> IResult<&'a [u8], PAppVersion<'a>> { +fn p_appversion<'a>(data: &'a [u8]) -> IResult<&'a [u8], PAppVersion> { let (r, (appname, appversion, appdate, num2, apparch, num3, appencoding, applocale)) = tuple((cmstring, cmstring, cmstring, be_u32, cmstring, be_u32, cmstring, cmstring))(&data)?; Ok((r, PAppVersion { - appname, - appversion, - appdate, + appname: String::from(appname), + appversion: String::from(appversion), + appdate: String::from(appdate), num2, - apparch, + apparch: String::from(apparch), num3, - appencoding, - applocale, + appencoding: String::from(appencoding), + applocale: String::from(applocale), })) } -- cgit v1.2.3