mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-21 03:36:06 +00:00
Move Rojo server into root of the repository
This commit is contained in:
parent
ec9afba029
commit
6f7dbe99fe
48 changed files with 50 additions and 54 deletions
18
src/impl_from.rs
Normal file
18
src/impl_from.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/// Implements 'From' for a list of variants, intended for use with error enums
|
||||
/// that are wrapping a number of errors from other methods.
|
||||
#[macro_export]
|
||||
macro_rules! impl_from {
|
||||
(
|
||||
$enum_name: ident {
|
||||
$($error_type: ty => $variant_name: ident),* $(,)*
|
||||
}
|
||||
) => {
|
||||
$(
|
||||
impl From<$error_type> for $enum_name {
|
||||
fn from(error: $error_type) -> $enum_name {
|
||||
$enum_name::$variant_name(error)
|
||||
}
|
||||
}
|
||||
)*
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue