aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-11-26 23:11:05 +0100
committerHarald Eilertsen <haraldei@anduin.net>2020-11-26 23:11:05 +0100
commit0c745edddca6eb3347486b7ce9c77b0bb3de54b1 (patch)
treed443fc491914e0fc919ae0dfef4e1ff897d53ffb
parent0a11e6d5e64121b94f4e0c8637a4ceab80804623 (diff)
downloadcbconv-0c745edddca6eb3347486b7ce9c77b0bb3de54b1.tar.gz
cbconv-0c745edddca6eb3347486b7ce9c77b0bb3de54b1.tar.bz2
cbconv-0c745edddca6eb3347486b7ce9c77b0bb3de54b1.zip
Don't shadow PAppVersion from cubase_project.rs.
-rw-r--r--src/main.rs29
1 files 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),
}))
}