From b9b1ba7d03c1e34d8510943d1fe2eb29350b3ebf Mon Sep 17 00:00:00 2001 From: Erica Marigold Date: Mon, 11 Mar 2024 22:37:16 +0530 Subject: [PATCH] feat(docs): add rustdoc comments --- src/cli/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli/build.rs b/src/cli/build.rs index ad6b24d..0c44756 100644 --- a/src/cli/build.rs +++ b/src/cli/build.rs @@ -49,6 +49,9 @@ pub struct BuildCommand { // TODO: Currently, the file we are patching is user provided, so we should // probably check whether the binary is a valid lune base binary first +// TODO: Handle whether the compiled bytecode may conflict among breaking luau +// versions + impl BuildCommand { pub async fn run(self) -> Result { let mut output_path = self @@ -119,16 +122,21 @@ async fn write_executable_file_to(path: impl AsRef, bytes: impl AsRef<[u8] Ok(()) } +/// Possible ways in which the discovery and/or download of a base binary's path can error #[derive(Debug, Clone, Error, PartialEq)] pub enum BasePathDiscoveryError { + /// An error in the decompression of the precompiled target #[error("decompression error")] Decompression(T), #[error("precompiled base for target not found for {target}")] TargetNotFound { target: String }, + /// An error in the precompiled target download process #[error("failed to download precompiled binary base")] DownloadError(T), + /// An IO related error #[error("a generic error related to an io operation occurred")] IoError(T), + /// Safe to continue, the user did not request any cross-compilation #[error("neither a custom base path or precompiled target name provided")] None, }