From 0ab32c89e35498266c496cdde9f37cf3d9596d1b Mon Sep 17 00:00:00 2001 From: howardwu Date: Sun, 2 Aug 2020 22:59:10 -0700 Subject: [PATCH] Moves imports in package --- package/src/directories/mod.rs | 3 --- package/src/errors/directory/mod.rs | 3 --- .../errors/{directory/imports.rs => imports/directory.rs} | 0 package/src/errors/imports/mod.rs | 2 ++ package/src/errors/mod.rs | 3 +++ package/src/files/zip.rs | 2 +- .../src/{directories/imports.rs => imports/directory.rs} | 0 package/src/imports/mod.rs | 2 ++ package/src/inputs/directory.rs | 6 ++---- package/src/lib.rs | 1 + package/src/outputs/directory.rs | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) rename package/src/errors/{directory/imports.rs => imports/directory.rs} (100%) create mode 100644 package/src/errors/imports/mod.rs rename package/src/{directories/imports.rs => imports/directory.rs} (100%) create mode 100644 package/src/imports/mod.rs diff --git a/package/src/directories/mod.rs b/package/src/directories/mod.rs index f7955972c9..6dd9d696d3 100644 --- a/package/src/directories/mod.rs +++ b/package/src/directories/mod.rs @@ -1,5 +1,2 @@ -pub mod imports; -pub use self::imports::*; - pub mod source; pub use self::source::*; diff --git a/package/src/errors/directory/mod.rs b/package/src/errors/directory/mod.rs index f7955972c9..6dd9d696d3 100644 --- a/package/src/errors/directory/mod.rs +++ b/package/src/errors/directory/mod.rs @@ -1,5 +1,2 @@ -pub mod imports; -pub use self::imports::*; - pub mod source; pub use self::source::*; diff --git a/package/src/errors/directory/imports.rs b/package/src/errors/imports/directory.rs similarity index 100% rename from package/src/errors/directory/imports.rs rename to package/src/errors/imports/directory.rs diff --git a/package/src/errors/imports/mod.rs b/package/src/errors/imports/mod.rs new file mode 100644 index 0000000000..c578ea2ef7 --- /dev/null +++ b/package/src/errors/imports/mod.rs @@ -0,0 +1,2 @@ +pub mod directory; +pub use directory::*; diff --git a/package/src/errors/mod.rs b/package/src/errors/mod.rs index 3cc75c45f7..1c158ceb1c 100644 --- a/package/src/errors/mod.rs +++ b/package/src/errors/mod.rs @@ -4,6 +4,9 @@ pub use self::directory::*; pub mod files; pub use self::files::*; +pub mod imports; +pub use imports::*; + pub mod inputs; pub use inputs::*; diff --git a/package/src/files/zip.rs b/package/src/files/zip.rs index ba6a73abd8..384e0a7458 100644 --- a/package/src/files/zip.rs +++ b/package/src/files/zip.rs @@ -1,8 +1,8 @@ //! The program package zip file. use crate::{ - directories::IMPORTS_DIRECTORY_NAME, errors::ZipFileError, + imports::IMPORTS_DIRECTORY_NAME, inputs::{INPUT_DIRECTORY_NAME, INPUT_FILE_EXTENSION}, outputs::{ CHECKSUM_FILE_EXTENSION, diff --git a/package/src/directories/imports.rs b/package/src/imports/directory.rs similarity index 100% rename from package/src/directories/imports.rs rename to package/src/imports/directory.rs diff --git a/package/src/imports/mod.rs b/package/src/imports/mod.rs new file mode 100644 index 0000000000..c578ea2ef7 --- /dev/null +++ b/package/src/imports/mod.rs @@ -0,0 +1,2 @@ +pub mod directory; +pub use directory::*; diff --git a/package/src/inputs/directory.rs b/package/src/inputs/directory.rs index 7db9b92ed7..b32e577c6b 100644 --- a/package/src/inputs/directory.rs +++ b/package/src/inputs/directory.rs @@ -1,10 +1,8 @@ -use crate::errors::InputDirectoryError; +use crate::{errors::InputDirectoryError, inputs::INPUT_FILE_EXTENSION}; use std::{fs, path::PathBuf}; -pub static INPUT_DIRECTORY_NAME: &str = "input/"; - -static INPUT_FILE_EXTENSION: &str = "leo.in"; +pub static INPUT_DIRECTORY_NAME: &str = "inputs/"; pub struct InputDirectory; diff --git a/package/src/lib.rs b/package/src/lib.rs index df0631d3e0..aa2f005adb 100644 --- a/package/src/lib.rs +++ b/package/src/lib.rs @@ -6,5 +6,6 @@ pub use errors::*; pub mod directories; pub mod files; +pub mod imports; pub mod inputs; pub mod outputs; diff --git a/package/src/outputs/directory.rs b/package/src/outputs/directory.rs index 0b1724ccc6..fe12a9fa69 100644 --- a/package/src/outputs/directory.rs +++ b/package/src/outputs/directory.rs @@ -2,7 +2,7 @@ use crate::errors::OutputDirectoryError; use std::{fs, path::PathBuf}; -pub static OUTPUT_DIRECTORY_NAME: &str = "output/"; +pub static OUTPUT_DIRECTORY_NAME: &str = "outputs/"; pub struct OutputDirectory;