Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getter for known migrations to runner. #120

Merged
merged 2 commits into from
Jul 14, 2020

Conversation

jakajancar
Copy link
Contributor

Fixes #117

@@ -230,7 +230,12 @@ impl Runner {
}
}

/// set the target version up to which refinery should migrate, Latest migrates to the latest version available
/// Get the known migrations.
pub fn get_migrations(self) -> Vec<Migration> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want to consume the Runner, should be &self

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I'm guessing

pub fn get_migrations(&self) -> &Vec<Migration> {
    &self.migrations
}

is better than

pub fn get_migrations(&self) -> Vec<Migration> {
    self.migrations.clone()
}

(new to Rust :))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, no need to clone, let the caller of the function decide if they want to call clone

refinery_core/src/runner.rs Outdated Show resolved Hide resolved
Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks :)

@jxs jxs merged commit 289397a into rust-db:master Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Get latest known migration / all known migrations
2 participants