From ca18417e2e144a1c4741efe68a3f8c9e250703ba Mon Sep 17 00:00:00 2001 From: Tom Kirchner Date: Mon, 10 Aug 2020 10:23:42 -0700 Subject: [PATCH] Fix warnings for use of deprecated items in common_migrations The singular `AddSettingMigration` and `RemoveSettingMigration` exist for backward compatibility and are marked deprecated. The trait implementations on those items have to reference the deprecated items, of course, but this triggers compiler warnings about use of the deprecated items. We only want warnings when people are actively using these types outside of the module that defines them; we don't want to see the warnings on every build. --- .../api/migration/migration-helpers/src/common_migrations.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sources/api/migration/migration-helpers/src/common_migrations.rs b/sources/api/migration/migration-helpers/src/common_migrations.rs index b0b49c535b9..da0945fe910 100644 --- a/sources/api/migration/migration-helpers/src/common_migrations.rs +++ b/sources/api/migration/migration-helpers/src/common_migrations.rs @@ -41,6 +41,7 @@ impl Migration for AddSettingsMigration<'_> { #[deprecated(note = "Please use `AddSettingsMigration` instead")] pub struct AddSettingMigration(pub &'static str); +#[allow(deprecated)] impl Migration for AddSettingMigration { fn forward(&mut self, input: MigrationData) -> Result { AddSettingsMigration(&[self.0]).forward(input) @@ -90,6 +91,7 @@ impl Migration for RemoveSettingsMigration<'_> { #[deprecated(note = "Please use `RemoveSettingsMigration` instead")] pub struct RemoveSettingMigration(pub &'static str); +#[allow(deprecated)] impl Migration for RemoveSettingMigration { fn forward(&mut self, input: MigrationData) -> Result { RemoveSettingsMigration(&[self.0]).forward(input)