mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-26 12:00:26 +00:00
Edit migrator to make it possible to create static instances
This commit is contained in:
@@ -6,7 +6,7 @@ use std::slice;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Migrator {
|
||||
migrations: Cow<'static, [Migration]>,
|
||||
pub migrations: Cow<'static, [Migration]>,
|
||||
}
|
||||
|
||||
impl Migrator {
|
||||
@@ -36,13 +36,6 @@ impl Migrator {
|
||||
})
|
||||
}
|
||||
|
||||
/// Creates a new instance from a static slice of migrations.
|
||||
pub fn from_static(migrations: &'static [Migration]) -> Self {
|
||||
Self {
|
||||
migrations: Cow::Borrowed(migrations),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get an iterator over all known migrations.
|
||||
pub fn iter(&self) -> slice::Iter<'_, Migration> {
|
||||
self.migrations.iter()
|
||||
|
||||
Reference in New Issue
Block a user