From e079574879369f1f9a44cdd19172a1da5d2422a1 Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Fri, 3 Nov 2017 12:28:41 -0700 Subject: [PATCH] Fixed diesel warnings --- src/config.rs | 8 ++++---- src/index.rs | 8 ++++---- src/playlist.rs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/config.rs b/src/config.rs index 2291d3b..69522b6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -155,8 +155,8 @@ pub fn amend(db: &T, new_config: &Config) -> Result<()> if let Some(ref mount_dirs) = new_config.mount_dirs { diesel::delete(mount_points::table) .execute(connection.deref())?; - diesel::insert(mount_dirs) - .into(mount_points::table) + diesel::insert_into(mount_points::table) + .values(mount_dirs) .execute(connection.deref())?; } @@ -184,8 +184,8 @@ pub fn amend(db: &T, new_config: &Config) -> Result<()> .collect::<_>(); for ref config_user in insert_users { let new_user = User::new(&config_user.name, &config_user.password, config_user.admin); - diesel::insert(&new_user) - .into(users::table) + diesel::insert_into(users::table) + .values(&new_user) .execute(connection.deref())?; } diff --git a/src/index.rs b/src/index.rs index bb4bde5..377c2b0 100644 --- a/src/index.rs +++ b/src/index.rs @@ -124,8 +124,8 @@ impl<'conn> IndexBuilder<'conn> { let connection = connection.deref(); connection .transaction::<_, Error, _>(|| { - diesel::insert(&self.new_songs) - .into(songs::table) + diesel::insert_into(songs::table) + .values(&self.new_songs) .execute(connection)?; Ok(()) })?; @@ -138,8 +138,8 @@ impl<'conn> IndexBuilder<'conn> { let connection = connection.deref(); connection .transaction::<_, Error, _>(|| { - diesel::insert(&self.new_directories) - .into(directories::table) + diesel::insert_into(directories::table) + .values(&self.new_directories) .execute(connection)?; Ok(()) })?; diff --git a/src/playlist.rs b/src/playlist.rs index 5fe58f7..39fd8ff 100644 --- a/src/playlist.rs +++ b/src/playlist.rs @@ -101,8 +101,8 @@ pub fn save_playlist(playlist_name: &str, owner: user.id, }; - diesel::insert(&new_playlist) - .into(playlists::table) + diesel::insert_into(playlists::table) + .values(&new_playlist) .execute(connection.deref())?; { @@ -140,8 +140,8 @@ pub fn save_playlist(playlist_name: &str, diesel::delete(old_songs).execute(connection.deref())?; // Insert content - diesel::insert(&new_songs) - .into(playlist_songs::table) + diesel::insert_into(playlist_songs::table) + .values(&new_songs) .execute(connection.deref())?; Ok(()) })?;