From 4844fe8b0728a353f9d18d78f47f565121e525d4 Mon Sep 17 00:00:00 2001 From: Able Date: Mon, 5 Dec 2022 00:43:08 -0600 Subject: [PATCH] update tar to have different names for errors and pub them --- Cargo.lock | 2 +- libraries/tar/Cargo.toml | 2 +- libraries/tar/src/lib.rs | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d09749..db5efd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,7 +248,7 @@ dependencies = [ [[package]] name = "tar" -version = "0.1.0" +version = "0.1.1" dependencies = [ "versioning", ] diff --git a/libraries/tar/Cargo.toml b/libraries/tar/Cargo.toml index 0cb766b..9e9281e 100644 --- a/libraries/tar/Cargo.toml +++ b/libraries/tar/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tar" -version = "0.1.0" +version = "0.1.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/libraries/tar/src/lib.rs b/libraries/tar/src/lib.rs index fecb1e5..425bca9 100644 --- a/libraries/tar/src/lib.rs +++ b/libraries/tar/src/lib.rs @@ -1,9 +1,7 @@ #![no_std] -pub const VERSION: versioning::Version = versioning::Version { - major: 0, - minor: 1, - patch: 0, -}; + +use versioning::Version; +pub const VERSION: Version = Version::new(0, 1, 1); pub struct Header { pub filename: [char; 100], @@ -93,7 +91,7 @@ fn from2tar() { // assert_eq!(array) } -enum Error { +pub enum TarError { InvalidChecksum, InvalidFileData, InvalidTarFormat, @@ -104,7 +102,7 @@ enum Error { } #[derive(Debug)] -enum FileType { +pub enum FileType { Directory, Regular, Other(char),