Skip to content

Commit

Permalink
Upgrade to Rust 1.71
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde committed Jul 13, 2023
1 parent a672b5a commit e2fc3ea
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 25 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repository = "https://gitlab.com/uklotzde/aoide-rs"
version = "0.8.0"
license = "AGPL-3.0-or-later"
edition = "2021"
rust-version = "1.70"
rust-version = "1.71"

[package]
name = "aoide"
Expand Down
33 changes: 16 additions & 17 deletions crates/repo-sqlite/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,6 @@ pub mod prelude {
pub type RepoTransactionError = DieselTransactionError<RepoError>;

pub(crate) use aoide_repo::RecordId as RowId;

#[cfg(test)]
pub mod tests {
use diesel::Connection as _;

use super::DbConnection;

pub type TestResult<T> = anyhow::Result<T>;

pub fn establish_connection() -> TestResult<DbConnection> {
let mut connection =
DbConnection::establish(":memory:").expect("in-memory database connection");
crate::run_migrations(&mut connection)
.map_err(|err| anyhow::anyhow!(err.to_string()))?;
Ok(connection)
}
}
}

pub mod repo;
Expand Down Expand Up @@ -191,3 +174,19 @@ const EMBEDDED_MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations");
pub fn run_migrations(connection: &mut DbConnection) -> MigrationResult<Vec<MigrationVersion<'_>>> {
connection.run_pending_migrations(EMBEDDED_MIGRATIONS)
}

#[cfg(test)]
pub mod tests {
use diesel::Connection as _;

use super::DbConnection;

pub type TestResult<T> = anyhow::Result<T>;

pub fn establish_connection() -> TestResult<DbConnection> {
let mut connection =
DbConnection::establish(":memory:").expect("in-memory database connection");
crate::run_migrations(&mut connection).map_err(|err| anyhow::anyhow!(err.to_string()))?;
Ok(connection)
}
}
2 changes: 1 addition & 1 deletion crates/repo-sqlite/src/repo/collection/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use aoide_core::{
use test_log::test;

use super::*;
use crate::prelude::tests::*;
use crate::tests::*;

struct Fixture {
db: DbConnection,
Expand Down
2 changes: 1 addition & 1 deletion crates/repo-sqlite/src/repo/media/source/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use mime::IMAGE_JPEG;
use test_log::test;

use super::*;
use crate::prelude::tests::*;
use crate::tests::*;

struct Fixture {
collection_id: CollectionId,
Expand Down
2 changes: 1 addition & 1 deletion crates/repo-sqlite/src/repo/media/tracker/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use aoide_repo::{
use test_log::test;

use super::*;
use crate::prelude::tests::*;
use crate::tests::*;

struct Fixture {
db: DbConnection,
Expand Down
2 changes: 1 addition & 1 deletion crates/repo-sqlite/src/repo/playlist/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use aoide_repo::{
use test_log::test;

use super::*;
use crate::prelude::tests::*;
use crate::tests::*;

struct Fixture {
collection_id: CollectionId,
Expand Down

0 comments on commit e2fc3ea

Please sign in to comment.