Skip to content

Commit

Permalink
Merge pull request #7 from schneems/schneems/fix-semicolons
Browse files Browse the repository at this point in the history
Add missing semicolons after macro calls
  • Loading branch information
schneems authored Dec 12, 2024
2 parents bb4ee6f + 3fdf85c commit d11d63a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## Unreleased

- Fix: Missing semicolons caused compilation errors when using 3 or more values in a chain. This is now fixed (https://github.com/schneems/magic_migrate/pull/7)

## 0.2.0 - 2024/05/12

- Introduce `try_migrate_toml_chain!`, `migrate_deserializer_chain!` and `try_migrate_deserializer_chain!` macros (https://github.com/schneems/magic_migrate/pull/5)
Expand Down
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub trait Migrate: From<Self::From> + Any + DeserializeOwned + Debug {
/// // support `From<Infallible>`
/// impl From<Infallible> for PersonMigrationError {
/// fn from(_value: Infallible) -> Self {
/// unreachable!()
/// unreachable!();
/// }
/// }
///
Expand Down Expand Up @@ -335,8 +335,8 @@ macro_rules! migrate_link {
$crate::migrate_link!($a, $b);

// Link B => C, and the rest
$crate::migrate_link!($b, $($rest),*)
)
$crate::migrate_link!($b, $($rest),*);
);
}

/// Links each struct passed in to each other to build a [`Migrate`] link chain.
Expand All @@ -361,15 +361,15 @@ macro_rules! migrate_link {
/// # struct UserV2;
/// # impl From<UserV1> for UserV2 {
/// # fn from(value: UserV1) -> Self {
/// # unimplemented!()
/// # unimplemented!();
/// # }
/// # }
/// #
/// # #[derive(Deserialize, Serialize, Debug)]
/// # struct UserV3;
/// # impl From<UserV2> for UserV3 {
/// # fn from(value: UserV2) -> Self {
/// # unimplemented!()
/// # unimplemented!();
/// # }
/// # }
///
Expand Down Expand Up @@ -397,7 +397,7 @@ macro_rules! migrate_toml_chain {
deserializer: toml::Deserializer::new,
chain: [$a, $($rest),+]
);
)
);
}

/// Macro for linking structs together in an infallible [`TryMigrate`] migration chain
Expand Down Expand Up @@ -434,8 +434,8 @@ macro_rules! try_migrate_link {
$crate::try_migrate_link!($a, $b);

// Link B => C, and the rest
$crate::try_migrate_link!($b, $($rest),*)
)
$crate::try_migrate_link!($b, $($rest),*);
);
}

/// A macro to help define [`TryMigrate`] based migrations
Expand Down Expand Up @@ -521,7 +521,7 @@ macro_rules! try_migrate_link {
macro_rules! try_migrate_toml_chain {
// Base case
(error: $err:ident, chain: [$a:ident] $(,)?) => {
$crate::try_migrate_deserializer_chain!(error: $err, deserializer: toml::Deserializer::new, chain: [$a])
$crate::try_migrate_deserializer_chain!(error: $err, deserializer: toml::Deserializer::new, chain: [$a]);
};
// Position variant
(chain: [$a:ident], error: $err:ident $(,)?) => {
Expand All @@ -537,7 +537,7 @@ macro_rules! try_migrate_toml_chain {
);
// Position variant
(chain: [$a:ident, $($rest:ident),+], error: $err:ident $(,)?) => (
$crate::try_migrate_toml_chain!(error: $err, chain: [$a, $($rest),+])
$crate::try_migrate_toml_chain!(error: $err, chain: [$a, $($rest),+]);
);
}

Expand Down Expand Up @@ -724,7 +724,7 @@ macro_rules! try_migrate_deserializer_chain {
}
impl From<Infallible> for $err {
fn from(_value: Infallible) -> Self {
unreachable!()
unreachable!();
}
}
};
Expand Down

0 comments on commit d11d63a

Please sign in to comment.