diff --git a/rslib/src/backend/card_rendering.rs b/rslib/src/backend/card_rendering.rs index e202c0284..609268e50 100644 --- a/rslib/src/backend/card_rendering.rs +++ b/rslib/src/backend/card_rendering.rs @@ -34,6 +34,5 @@ impl BackendCardRenderingService for Backend { request.speed, &request.text, ) - .map(Into::into) } } diff --git a/rslib/src/backend/config.rs b/rslib/src/backend/config.rs index 6e0bed153..349f2d9af 100644 --- a/rslib/src/backend/config.rs +++ b/rslib/src/backend/config.rs @@ -77,7 +77,6 @@ impl crate::services::ConfigService for Collection { ) -> Result<()> { let val: Value = serde_json::from_slice(&input.value_json)?; self.transact_no_undo(|col| col.set_config(input.key.as_str(), &val).map(|_| ())) - .map(Into::into) } fn remove_config( diff --git a/rslib/src/backend/import_export.rs b/rslib/src/backend/import_export.rs index 5ecf79582..6b2a6cb2f 100644 --- a/rslib/src/backend/import_export.rs +++ b/rslib/src/backend/import_export.rs @@ -18,9 +18,7 @@ impl BackendImportExportService for Backend { let mut guard = self.lock_open_collection()?; let col_inner = guard.take().unwrap(); - col_inner - .export_colpkg(input.out_path, input.include_media, input.legacy) - .map(Into::into) + col_inner.export_colpkg(input.out_path, input.include_media, input.legacy) } fn import_collection_package( @@ -36,6 +34,5 @@ impl BackendImportExportService for Backend { Path::new(&input.media_db), self.new_progress_handler(), ) - .map(Into::into) } } diff --git a/rslib/src/backend/sync.rs b/rslib/src/backend/sync.rs index 03cf12686..fc198e8da 100644 --- a/rslib/src/backend/sync.rs +++ b/rslib/src/backend/sync.rs @@ -99,7 +99,7 @@ impl TryFrom for SyncAuth { impl crate::services::BackendSyncService for Backend { fn sync_media(&self, input: anki_proto::sync::SyncAuth) -> Result<()> { let auth = input.try_into()?; - self.sync_media_in_background(auth, None).map(Into::into) + self.sync_media_in_background(auth, None) } fn media_sync_status(&self) -> Result { diff --git a/rslib/src/card/service.rs b/rslib/src/card/service.rs index 950cf8528..63824b789 100644 --- a/rslib/src/card/service.rs +++ b/rslib/src/card/service.rs @@ -131,7 +131,7 @@ impl From for anki_proto::cards::Card { original_due: c.original_due, original_deck_id: c.original_deck_id.0, flags: c.flags as u32, - original_position: c.original_position.map(Into::into), + original_position: c.original_position, memory_state: c.memory_state.map(Into::into), desired_retention: c.desired_retention, custom_data: c.custom_data, diff --git a/rslib/src/deckconfig/service.rs b/rslib/src/deckconfig/service.rs index 257270ac6..5776299fb 100644 --- a/rslib/src/deckconfig/service.rs +++ b/rslib/src/deckconfig/service.rs @@ -21,7 +21,6 @@ impl crate::services::DeckConfigService for Collection { col.add_or_update_deck_config_legacy(&mut conf)?; Ok(anki_proto::deck_config::DeckConfigId { dcid: conf.id.0 }) }) - .map(Into::into) } fn all_deck_config_legacy(&mut self) -> Result { @@ -62,7 +61,6 @@ impl crate::services::DeckConfigService for Collection { fn remove_deck_config(&mut self, input: anki_proto::deck_config::DeckConfigId) -> Result<()> { self.transact_no_undo(|col| col.remove_deck_config_inner(input.into())) - .map(Into::into) } fn get_deck_configs_for_update( diff --git a/rslib/src/scheduler/service/mod.rs b/rslib/src/scheduler/service/mod.rs index b66b1e565..9f2116c5d 100644 --- a/rslib/src/scheduler/service/mod.rs +++ b/rslib/src/scheduler/service/mod.rs @@ -55,7 +55,7 @@ impl crate::services::SchedulerService for Collection { self.transact_no_undo(|col| { let today = col.current_due_day(0)?; let usn = col.usn()?; - col.update_deck_stats(today, usn, input).map(Into::into) + col.update_deck_stats(today, usn, input) }) } @@ -70,7 +70,6 @@ impl crate::services::SchedulerService for Collection { input.new_delta, input.review_delta, ) - .map(Into::into) }) } @@ -229,7 +228,6 @@ impl crate::services::SchedulerService for Collection { fn upgrade_scheduler(&mut self) -> Result<()> { self.transact_no_undo(|col| col.upgrade_to_v2_scheduler()) - .map(Into::into) } fn get_queued_cards( diff --git a/rslib/src/search/service/mod.rs b/rslib/src/search/service/mod.rs index 7b8a62d90..01efbcfdd 100644 --- a/rslib/src/search/service/mod.rs +++ b/rslib/src/search/service/mod.rs @@ -129,7 +129,7 @@ impl crate::services::SearchService for Collection { &mut self, input: generic::Int64, ) -> Result { - self.browser_row_for_id(input.val).map(Into::into) + self.browser_row_for_id(input.val) } } diff --git a/rslib/src/stats/service.rs b/rslib/src/stats/service.rs index 077fd38fa..e9ae86f3c 100644 --- a/rslib/src/stats/service.rs +++ b/rslib/src/stats/service.rs @@ -34,7 +34,7 @@ impl crate::services::StatsService for Collection { &mut self, input: anki_proto::stats::GraphPreferences, ) -> error::Result<()> { - self.set_graph_preferences(input).map(Into::into) + self.set_graph_preferences(input) } } diff --git a/rslib/src/storage/deck/mod.rs b/rslib/src/storage/deck/mod.rs index e6db323b6..7b1e08d58 100644 --- a/rslib/src/storage/deck/mod.rs +++ b/rslib/src/storage/deck/mod.rs @@ -82,7 +82,6 @@ impl SqliteStorage { .query_and_then([machine_name], row_to_deck)? .next() .transpose() - .map_err(Into::into) } pub(crate) fn get_all_decks(&self) -> Result> { diff --git a/rslib/src/storage/deckconfig/mod.rs b/rslib/src/storage/deckconfig/mod.rs index 56306a74f..2103e1512 100644 --- a/rslib/src/storage/deckconfig/mod.rs +++ b/rslib/src/storage/deckconfig/mod.rs @@ -68,7 +68,6 @@ impl SqliteStorage { .query_and_then([name], |row| Ok::<_, AnkiError>(DeckConfigId(row.get(0)?)))? .next() .transpose() - .map_err(Into::into) } pub(crate) fn add_deck_conf(&self, conf: &mut DeckConfig) -> Result<()> { diff --git a/rslib/src/storage/note/mod.rs b/rslib/src/storage/note/mod.rs index 03c82e919..554753717 100644 --- a/rslib/src/storage/note/mod.rs +++ b/rslib/src/storage/note/mod.rs @@ -280,7 +280,7 @@ impl super::SqliteStorage { include_str!("get.sql"), " WHERE id IN (SELECT nid FROM search_nids)" ))? - .query_and_then([], |r| row_to_note(r).map_err(Into::into))? + .query_and_then([], row_to_note)? .collect() } diff --git a/rslib/src/storage/revlog/mod.rs b/rslib/src/storage/revlog/mod.rs index 2c0a553fe..043014499 100644 --- a/rslib/src/storage/revlog/mod.rs +++ b/rslib/src/storage/revlog/mod.rs @@ -175,7 +175,7 @@ impl SqliteStorage { pub(crate) fn get_all_revlog_entries(&self, after: TimestampSecs) -> Result> { self.db .prepare_cached(concat!(include_str!("get.sql"), " where id >= ?"))? - .query_and_then([after.0 * 1000], |r| row_to_revlog_entry(r).map(Into::into))? + .query_and_then([after.0 * 1000], row_to_revlog_entry)? .collect() } diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index 0f94e79df..c202bb0ef 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -410,7 +410,7 @@ fn schema_version(db: &Connection) -> Result<(bool, u8)> { Ok(( false, - db.query_row("select ver from col", [], |r| r.get(0).map_err(Into::into))?, + db.query_row("select ver from col", [], |r| r.get(0))?, )) } diff --git a/rslib/src/sync/http_server/media_manager/upload.rs b/rslib/src/sync/http_server/media_manager/upload.rs index cf6551c5a..6a37cba61 100644 --- a/rslib/src/sync/http_server/media_manager/upload.rs +++ b/rslib/src/sync/http_server/media_manager/upload.rs @@ -79,7 +79,7 @@ impl ServerMediaManager { } fn add_or_replace_file(path: &Path, data: Vec) -> error::Result<(), FileIoError> { - write_file(path, data).map_err(Into::into) + write_file(path, data) } fn remove_file(path: &Path) -> error::Result<(), FileIoError> { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 81ba7b7d9..608f0e356 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] # older versions may fail to compile; newer versions may fail the clippy tests -channel = "1.84.0" +channel = "1.85.0"