-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ exclude = [ | |
"projects/.DS_Store", | ||
] | ||
|
||
[workspace.dependencies] | ||
|
||
[profile.release] | ||
lto = true | ||
panic = "abort" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,9 +4,11 @@ publish = false | |
version = "0.0.0" | ||
authors = ["Aster <[email protected]>"] | ||
description = "..." | ||
repository = "https://github.com/oovm/sub_projects" | ||
categories = ["rust-patterns"] | ||
homepage = "https://github.com/oovm/RustTemplate" | ||
repository = "https://github.com/oovm/RustTemplate" | ||
documentation = "https://docs.rs/sub_projects" | ||
readme = "Readme.md" | ||
readme = "readme.md" | ||
license = "MPL-2.0" | ||
edition = "2021" | ||
exclude = ["package.json", "tests/**"] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use super::*; | ||
|
||
impl From<ExampleErrorKind> for ExampleError { | ||
fn from(value: ExampleErrorKind) -> Self { | ||
Self { | ||
kind: Box::new(value), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
use super::*; | ||
|
||
impl Error for ExampleError {} | ||
|
||
|
||
impl Debug for ExampleError { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
Debug::fmt(&self.kind, f) | ||
} | ||
} | ||
|
||
impl Display for ExampleError { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
Display::fmt(&self.kind, f) | ||
} | ||
} | ||
|
||
|
||
impl Display for ExampleErrorKind { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | ||
match self { ExampleErrorKind::UnknownError => { write!(f, "UnknownError") } } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use std::fmt::{Debug, Formatter}; | ||
use std::error::Error; | ||
use std::fmt::Display; | ||
|
||
mod display; | ||
mod convert; | ||
|
||
/// The result type of this crate. | ||
pub type Result<T> = std::result::Result<T, ExampleError>; | ||
|
||
/// A boxed error kind, wrapping an [ExampleErrorKind]. | ||
#[derive(Clone)] | ||
pub struct ExampleError { | ||
kind: Box<ExampleErrorKind>, | ||
} | ||
|
||
/// The kind of [ExampleError]. | ||
#[derive(Debug, Copy, Clone)] | ||
pub enum ExampleErrorKind { | ||
/// An unknown error. | ||
UnknownError | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters