Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Typos fixed, improved error handling.
  • Loading branch information
sharma-shray authored Oct 9, 2024
1 parent 381be19 commit 2bf19dd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions diesel_migrations/src/file_based_migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ impl FileBasedMigrations {
})
}

/// Create a new file based migration source by searching the migration diretcory
/// Create a new file based migration source by searching the migration directory
///
/// This method looks in the current and all parent directories for a folder named
/// `migrations`
Expand All @@ -108,7 +108,7 @@ impl FileBasedMigrations {
Self::find_migrations_directory_in_path(std::env::current_dir()?.as_path())
}

/// Create a new file based migration source by searching a give path for the migration
/// Create a new file based migration source by searching a given path for the migration
/// directory
///
/// This method looks in the passed directory and all parent directories for a folder
Expand Down Expand Up @@ -162,8 +162,10 @@ struct SqlFileMigration {
impl SqlFileMigration {
fn from_path(path: &Path) -> Result<Self, MigrationError> {
if migrations_internals::valid_sql_migration_directory(path) {
let metadata_path = path.join("metadata.toml");
let metadata = TomlMetadataWrapper(
TomlMetadata::read_from_file(&path.join("metadata.toml")).unwrap_or_default(),
TomlMetadata::read_from_file(&metadata_path)
.map_err(|e| MigrationError::from(e))?
);
Ok(Self {
base_path: path.to_path_buf(),
Expand Down

0 comments on commit 2bf19dd

Please sign in to comment.