mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-27 02:24:15 +03:00
deprecate crate failure in favor of thiserror
This commit is contained in:
parent
6ab1ce6e71
commit
abb50628a0
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -478,7 +478,6 @@ dependencies = [
|
|||||||
"clap",
|
"clap",
|
||||||
"colored",
|
"colored",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"failure",
|
|
||||||
"from-pest",
|
"from-pest",
|
||||||
"leo-compiler",
|
"leo-compiler",
|
||||||
"log",
|
"log",
|
||||||
@ -493,6 +492,7 @@ dependencies = [
|
|||||||
"snarkos-models",
|
"snarkos-models",
|
||||||
"snarkos-utilities",
|
"snarkos-utilities",
|
||||||
"structopt",
|
"structopt",
|
||||||
|
"thiserror",
|
||||||
"toml",
|
"toml",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ snarkos-utilities = { path = "../snarkOS/utilities", version = "0.8.0" }
|
|||||||
clap = { version = "2.33.0" }
|
clap = { version = "2.33.0" }
|
||||||
colored = { version = "1.9" }
|
colored = { version = "1.9" }
|
||||||
env_logger = { version = "0.7" }
|
env_logger = { version = "0.7" }
|
||||||
failure = { version = "0.1.5" }
|
|
||||||
from-pest = { version = "0.3.1" }
|
from-pest = { version = "0.3.1" }
|
||||||
log = { version = "0.4" }
|
log = { version = "0.4" }
|
||||||
rand = { version = "0.7" }
|
rand = { version = "0.7" }
|
||||||
@ -37,3 +36,4 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
serde_json = { version = "1.0" }
|
serde_json = { version = "1.0" }
|
||||||
structopt = { version = "0.3.14" }
|
structopt = { version = "0.3.14" }
|
||||||
toml = { version = "0.5" }
|
toml = { version = "0.5" }
|
||||||
|
thiserror = { version = "1.0" }
|
||||||
|
@ -88,8 +88,8 @@ impl CLI for BuildCommand {
|
|||||||
// bt: vec![],
|
// bt: vec![],
|
||||||
// ct: vec![],
|
// ct: vec![],
|
||||||
// };
|
// };
|
||||||
program.evaluate_program::<KeypairAssembly::<Bls12_377>>()?;
|
|
||||||
}
|
}
|
||||||
|
program.evaluate_program::<KeypairAssembly::<Bls12_377>>()?;
|
||||||
|
|
||||||
log::info!("Compiled program in {:?}", main_file_path);
|
log::info!("Compiled program in {:?}", main_file_path);
|
||||||
|
|
||||||
|
@ -1,47 +1,47 @@
|
|||||||
use crate::errors::*;
|
use crate::errors::*;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum CLIError {
|
pub enum CLIError {
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
BuildError(BuildError),
|
BuildError(BuildError),
|
||||||
|
|
||||||
#[fail(display = "{}: {}", _0, _1)]
|
#[error("{}: {}", _0, _1)]
|
||||||
Crate(&'static str, String),
|
Crate(&'static str, String),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ChecksumFileError(ChecksumFileError),
|
ChecksumFileError(ChecksumFileError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
InitError(InitError),
|
InitError(InitError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
InputsDirectoryError(InputsDirectoryError),
|
InputsDirectoryError(InputsDirectoryError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
MainFileError(MainFileError),
|
MainFileError(MainFileError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ManifestError(ManifestError),
|
ManifestError(ManifestError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
NewError(NewError),
|
NewError(NewError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
OutputsDirectoryError(OutputsDirectoryError),
|
OutputsDirectoryError(OutputsDirectoryError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ProofFileError(ProofFileError),
|
ProofFileError(ProofFileError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ProvingKeyFileError(ProvingKeyFileError),
|
ProvingKeyFileError(ProvingKeyFileError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
RunError(RunError),
|
RunError(RunError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
SourceDirectoryError(SourceDirectoryError),
|
SourceDirectoryError(SourceDirectoryError),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
VerificationKeyFileError(VerificationKeyFileError),
|
VerificationKeyFileError(VerificationKeyFileError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@ use crate::errors::ManifestError;
|
|||||||
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum BuildError {
|
pub enum BuildError {
|
||||||
#[fail(display = "main file {:?} does not exist", _0)]
|
#[error("main file {:?} does not exist", _0)]
|
||||||
MainFileDoesNotExist(OsString),
|
MainFileDoesNotExist(OsString),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ManifestError(ManifestError),
|
ManifestError(ManifestError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,21 +3,21 @@ use crate::errors::ManifestError;
|
|||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum InitError {
|
pub enum InitError {
|
||||||
#[fail(display = "root directory {:?} creating: {}", _0, _1)]
|
#[error("root directory {:?} creating: {}", _0, _1)]
|
||||||
CreatingRootDirectory(OsString, io::Error),
|
CreatingRootDirectory(OsString, io::Error),
|
||||||
|
|
||||||
#[fail(display = "directory {:?} does not exist", _0)]
|
#[error("directory {:?} does not exist", _0)]
|
||||||
DirectoryDoesNotExist(OsString),
|
DirectoryDoesNotExist(OsString),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ManifestError(ManifestError),
|
ManifestError(ManifestError),
|
||||||
|
|
||||||
#[fail(display = "package at path {:?} already exists", _0)]
|
#[error("package at path {:?} already exists", _0)]
|
||||||
PackageAlreadyExists(OsString),
|
PackageAlreadyExists(OsString),
|
||||||
|
|
||||||
#[fail(display = "package name is missing - {:?}", _0)]
|
#[error("package name is missing - {:?}", _0)]
|
||||||
ProjectNameInvalid(OsString),
|
ProjectNameInvalid(OsString),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,21 +3,21 @@ use crate::errors::ManifestError;
|
|||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum NewError {
|
pub enum NewError {
|
||||||
#[fail(display = "root directory {:?} creating: {}", _0, _1)]
|
#[error("root directory {:?} creating: {}", _0, _1)]
|
||||||
CreatingRootDirectory(OsString, io::Error),
|
CreatingRootDirectory(OsString, io::Error),
|
||||||
|
|
||||||
#[fail(display = "directory {:?} already exists", _0)]
|
#[error("directory {:?} already exists", _0)]
|
||||||
DirectoryAlreadyExists(OsString),
|
DirectoryAlreadyExists(OsString),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ManifestError(ManifestError),
|
ManifestError(ManifestError),
|
||||||
|
|
||||||
#[fail(display = "package at path {:?} already exists", _0)]
|
#[error("package at path {:?} already exists", _0)]
|
||||||
PackageAlreadyExists(OsString),
|
PackageAlreadyExists(OsString),
|
||||||
|
|
||||||
#[fail(display = "package name is missing - {:?}", _0)]
|
#[error("package name is missing - {:?}", _0)]
|
||||||
ProjectNameInvalid(OsString),
|
ProjectNameInvalid(OsString),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,12 +2,12 @@ use crate::errors::ManifestError;
|
|||||||
|
|
||||||
use std::ffi::OsString;
|
use std::ffi::OsString;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum RunError {
|
pub enum RunError {
|
||||||
#[fail(display = "main file {:?} does not exist", _0)]
|
#[error("main file {:?} does not exist", _0)]
|
||||||
MainFileDoesNotExist(OsString),
|
MainFileDoesNotExist(OsString),
|
||||||
|
|
||||||
#[fail(display = "{}", _0)]
|
#[error("{}", _0)]
|
||||||
ManifestError(ManifestError),
|
ManifestError(ManifestError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
use std::{ffi::OsString, fs::FileType, io};
|
use std::{ffi::OsString, fs::FileType, io};
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum InputsDirectoryError {
|
pub enum InputsDirectoryError {
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "file entry getting: {}", _0)]
|
#[error("file entry getting: {}", _0)]
|
||||||
GettingFileEntry(io::Error),
|
GettingFileEntry(io::Error),
|
||||||
|
|
||||||
#[fail(display = "file {:?} extension getting", _0)]
|
#[error("file {:?} extension getting", _0)]
|
||||||
GettingFileExtension(OsString),
|
GettingFileExtension(OsString),
|
||||||
|
|
||||||
#[fail(display = "file {:?} type getting: {}", _0, _1)]
|
#[error("file {:?} type getting: {}", _0, _1)]
|
||||||
GettingFileType(OsString, io::Error),
|
GettingFileType(OsString, io::Error),
|
||||||
|
|
||||||
#[fail(display = "invalid file {:?} extension: {:?}", _0, _1)]
|
#[error("invalid file {:?} extension: {:?}", _0, _1)]
|
||||||
InvalidFileExtension(OsString, OsString),
|
InvalidFileExtension(OsString, OsString),
|
||||||
|
|
||||||
#[fail(display = "invalid file {:?} type: {:?}", _0, _1)]
|
#[error("invalid file {:?} type: {:?}", _0, _1)]
|
||||||
InvalidFileType(OsString, FileType),
|
InvalidFileType(OsString, FileType),
|
||||||
|
|
||||||
#[fail(display = "reading: {}", _0)]
|
#[error("reading: {}", _0)]
|
||||||
Reading(io::Error),
|
Reading(io::Error),
|
||||||
}
|
}
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
use std::{ffi::OsString, fs::FileType, io};
|
use std::{ffi::OsString, fs::FileType, io};
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum OutputsDirectoryError {
|
pub enum OutputsDirectoryError {
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "file entry getting: {}", _0)]
|
#[error("file entry getting: {}", _0)]
|
||||||
GettingFileEntry(io::Error),
|
GettingFileEntry(io::Error),
|
||||||
|
|
||||||
#[fail(display = "file {:?} extension getting", _0)]
|
#[error("file {:?} extension getting", _0)]
|
||||||
GettingFileExtension(OsString),
|
GettingFileExtension(OsString),
|
||||||
|
|
||||||
#[fail(display = "file {:?} type getting: {}", _0, _1)]
|
#[error("file {:?} type getting: {}", _0, _1)]
|
||||||
GettingFileType(OsString, io::Error),
|
GettingFileType(OsString, io::Error),
|
||||||
|
|
||||||
#[fail(display = "invalid file {:?} extension: {:?}", _0, _1)]
|
#[error("invalid file {:?} extension: {:?}", _0, _1)]
|
||||||
InvalidFileExtension(OsString, OsString),
|
InvalidFileExtension(OsString, OsString),
|
||||||
|
|
||||||
#[fail(display = "invalid file {:?} type: {:?}", _0, _1)]
|
#[error("invalid file {:?} type: {:?}", _0, _1)]
|
||||||
InvalidFileType(OsString, FileType),
|
InvalidFileType(OsString, FileType),
|
||||||
|
|
||||||
#[fail(display = "reading: {}", _0)]
|
#[error("reading: {}", _0)]
|
||||||
Reading(io::Error),
|
Reading(io::Error),
|
||||||
|
|
||||||
#[fail(display = "removing: {}", _0)]
|
#[error("removing: {}", _0)]
|
||||||
Removing(io::Error),
|
Removing(io::Error),
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,25 @@
|
|||||||
use std::{ffi::OsString, fs::FileType, io};
|
use std::{ffi::OsString, fs::FileType, io};
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum SourceDirectoryError {
|
pub enum SourceDirectoryError {
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "file entry getting: {}", _0)]
|
#[error("file entry getting: {}", _0)]
|
||||||
GettingFileEntry(io::Error),
|
GettingFileEntry(io::Error),
|
||||||
|
|
||||||
#[fail(display = "file {:?} extension getting", _0)]
|
#[error("file {:?} extension getting", _0)]
|
||||||
GettingFileExtension(OsString),
|
GettingFileExtension(OsString),
|
||||||
|
|
||||||
#[fail(display = "file {:?} type getting: {}", _0, _1)]
|
#[error("file {:?} type getting: {}", _0, _1)]
|
||||||
GettingFileType(OsString, io::Error),
|
GettingFileType(OsString, io::Error),
|
||||||
|
|
||||||
#[fail(display = "invalid file {:?} extension: {:?}", _0, _1)]
|
#[error("invalid file {:?} extension: {:?}", _0, _1)]
|
||||||
InvalidFileExtension(OsString, OsString),
|
InvalidFileExtension(OsString, OsString),
|
||||||
|
|
||||||
#[fail(display = "invalid file {:?} type: {:?}", _0, _1)]
|
#[error("invalid file {:?} type: {:?}", _0, _1)]
|
||||||
InvalidFileType(OsString, FileType),
|
InvalidFileType(OsString, FileType),
|
||||||
|
|
||||||
#[fail(display = "reading: {}", _0)]
|
#[error("reading: {}", _0)]
|
||||||
Reading(io::Error),
|
Reading(io::Error),
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum ChecksumFileError {
|
pub enum ChecksumFileError {
|
||||||
#[fail(display = "{}: {}", _0, _1)]
|
#[error("{}: {}", _0, _1)]
|
||||||
Crate(&'static str, String),
|
Crate(&'static str, String),
|
||||||
|
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "Cannot read from the provided file path - {:?}", _0)]
|
#[error("Cannot read from the provided file path - {:?}", _0)]
|
||||||
FileReadError(PathBuf),
|
FileReadError(PathBuf),
|
||||||
|
|
||||||
#[fail(display = "writing: {}", _0)]
|
#[error("writing: {}", _0)]
|
||||||
Writing(io::Error),
|
Writing(io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum MainFileError {
|
pub enum MainFileError {
|
||||||
#[fail(display = "{}: {}", _0, _1)]
|
#[error("{}: {}", _0, _1)]
|
||||||
Crate(&'static str, String),
|
Crate(&'static str, String),
|
||||||
|
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "writing: {}", _0)]
|
#[error("writing: {}", _0)]
|
||||||
Writing(io::Error),
|
Writing(io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum ProofFileError {
|
pub enum ProofFileError {
|
||||||
#[fail(display = "{}: {}", _0, _1)]
|
#[error("{}: {}", _0, _1)]
|
||||||
Crate(&'static str, String),
|
Crate(&'static str, String),
|
||||||
|
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "Cannot read from the provided file path - {:?}", _0)]
|
#[error("Cannot read from the provided file path - {:?}", _0)]
|
||||||
FileReadError(PathBuf),
|
FileReadError(PathBuf),
|
||||||
|
|
||||||
#[fail(display = "writing: {}", _0)]
|
#[error("writing: {}", _0)]
|
||||||
Writing(io::Error),
|
Writing(io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum ProvingKeyFileError {
|
pub enum ProvingKeyFileError {
|
||||||
#[fail(display = "{}: {}", _0, _1)]
|
#[error("{}: {}", _0, _1)]
|
||||||
Crate(&'static str, String),
|
Crate(&'static str, String),
|
||||||
|
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "Cannot read from the provided file path - {:?}", _0)]
|
#[error("Cannot read from the provided file path - {:?}", _0)]
|
||||||
FileReadError(PathBuf),
|
FileReadError(PathBuf),
|
||||||
|
|
||||||
#[fail(display = "writing: {}", _0)]
|
#[error("writing: {}", _0)]
|
||||||
Writing(io::Error),
|
Writing(io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum VerificationKeyFileError {
|
pub enum VerificationKeyFileError {
|
||||||
#[fail(display = "{}: {}", _0, _1)]
|
#[error("{}: {}", _0, _1)]
|
||||||
Crate(&'static str, String),
|
Crate(&'static str, String),
|
||||||
|
|
||||||
#[fail(display = "creating: {}", _0)]
|
#[error("creating: {}", _0)]
|
||||||
Creating(io::Error),
|
Creating(io::Error),
|
||||||
|
|
||||||
#[fail(display = "Cannot read from the provided file path - {:?}", _0)]
|
#[error("Cannot read from the provided file path - {:?}", _0)]
|
||||||
FileReadError(PathBuf),
|
FileReadError(PathBuf),
|
||||||
|
|
||||||
#[fail(display = "Verification key file was corrupted")]
|
#[error("Verification key file was corrupted")]
|
||||||
IncorrectVerificationKey,
|
IncorrectVerificationKey,
|
||||||
|
|
||||||
#[fail(display = "writing: {}", _0)]
|
#[error("writing: {}", _0)]
|
||||||
Writing(io::Error),
|
Writing(io::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,22 +1,22 @@
|
|||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
#[derive(Debug, Fail)]
|
#[derive(Debug, Error)]
|
||||||
pub enum ManifestError {
|
pub enum ManifestError {
|
||||||
#[fail(display = "`{}` creating: {}", _0, _1)]
|
#[error("`{}` creating: {}", _0, _1)]
|
||||||
Creating(&'static str, io::Error),
|
Creating(&'static str, io::Error),
|
||||||
|
|
||||||
#[fail(display = "`{}` metadata: {}", _0, _1)]
|
#[error("`{}` metadata: {}", _0, _1)]
|
||||||
Metadata(&'static str, io::Error),
|
Metadata(&'static str, io::Error),
|
||||||
|
|
||||||
#[fail(display = "`{}` opening: {}", _0, _1)]
|
#[error("`{}` opening: {}", _0, _1)]
|
||||||
Opening(&'static str, io::Error),
|
Opening(&'static str, io::Error),
|
||||||
|
|
||||||
#[fail(display = "`{}` parsing: {}", _0, _1)]
|
#[error("`{}` parsing: {}", _0, _1)]
|
||||||
Parsing(&'static str, toml::de::Error),
|
Parsing(&'static str, toml::de::Error),
|
||||||
|
|
||||||
#[fail(display = "`{}` reading: {}", _0, _1)]
|
#[error("`{}` reading: {}", _0, _1)]
|
||||||
Reading(&'static str, io::Error),
|
Reading(&'static str, io::Error),
|
||||||
|
|
||||||
#[fail(display = "`{}` writing: {}", _0, _1)]
|
#[error("`{}` writing: {}", _0, _1)]
|
||||||
Writing(&'static str, io::Error),
|
Writing(&'static str, io::Error),
|
||||||
}
|
}
|
||||||
|
@ -49,8 +49,8 @@ impl MainFile {
|
|||||||
fn template(&self) -> String {
|
fn template(&self) -> String {
|
||||||
format!(
|
format!(
|
||||||
r#"// The '{}' main function.
|
r#"// The '{}' main function.
|
||||||
function main() -> (u32) {{
|
function main() -> u32 {{
|
||||||
a = 1 + 1;
|
let a = 1 + 1;
|
||||||
return a
|
return a
|
||||||
}}
|
}}
|
||||||
"#,
|
"#,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate failure;
|
extern crate thiserror;
|
||||||
|
|
||||||
#[cfg_attr(tarpaulin, skip)]
|
#[cfg_attr(tarpaulin, skip)]
|
||||||
pub mod cli;
|
pub mod cli;
|
||||||
|
Loading…
Reference in New Issue
Block a user