#![allow(
dead_code,
clippy::missing_docs_in_private_items,
clippy::missing_const_for_fn,
reason = "Example"
)]
use ::neuer_error::{NeuErr, Result, traits::*};
use ::std::process::ExitCode;
fn ensure_project_validity() -> Result<()> {
Ok(())
}
fn call_preprocessor() -> Result<()> {
Err(NeuErr::new("Binary gcc not found").into())
}
fn compile_my_code() -> Result<()> {
ensure_project_validity().context("Project must be valid for compiling")?;
call_preprocessor().context("Preprocessor failed")?;
Ok(())
}
fn lint() -> Result<()> {
Err(NeuErr::new("Warning: something is deprecated").attach_override(ExitCode::SUCCESS).into())
}
fn main() -> Result<()> {
ensure_project_validity().context("Project is invalid")?;
compile_my_code().context("Failed compiling code")?;
lint()?;
Ok(())
}