From a16f1ce105959b37bd5776476352b92905ff12d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20H=C3=B6lting?= <87192362+moritz-hoelting@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:05:04 +0200 Subject: [PATCH] Generalize VFolder, implement Read & Write for VFile and improve docs --- .github/workflows/test.yml | 4 +++ src/datapack/command/execute.rs | 2 ++ src/virtual_fs.rs | 56 ++++++++++++++++++++++++++++++--- 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 74d11be..845e627 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ name: Cargo build & test on: push: + branches: + - main + - development + - 'releases/**' pull_request: env: diff --git a/src/datapack/command/execute.rs b/src/datapack/command/execute.rs index ec56462..573b01e 100644 --- a/src/datapack/command/execute.rs +++ b/src/datapack/command/execute.rs @@ -8,6 +8,7 @@ use crate::util::{ ExtendableQueue, }; +/// Execute command with all its variants. #[allow(missing_docs)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Debug, Clone, PartialEq, Eq, Hash)] @@ -369,6 +370,7 @@ fn combine_conditions_commands( .collect() } +/// Condition for the execute command. #[allow(missing_docs)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[derive(Debug, Clone, PartialEq, Eq, Hash)] diff --git a/src/virtual_fs.rs b/src/virtual_fs.rs index aee8aec..7d5328e 100644 --- a/src/virtual_fs.rs +++ b/src/virtual_fs.rs @@ -131,13 +131,17 @@ impl VFolder { /// # Errors /// - If the folder cannot be written #[cfg(feature = "fs_access")] - pub fn place(&self, path: &Path) -> std::io::Result<()> { + pub fn place
(&self, path: P) -> std::io::Result<()>
+ where
+ P: AsRef (&self, path: P) -> std::io::Result<()>
+ where
+ P: AsRef (&self, path: P, comment: S) -> std::io::Result<()>
where
+ P: AsRef(&self, path: &Path, comment: S) -> std::io::Result<()>
+ pub fn zip_with_comment