Skip to content

Commit 218757c

Browse files
committed
Update to Rust 1.85
Edition update to follow later (cherry picked from commit 2727cf3)
1 parent 832a1c2 commit 218757c

File tree

16 files changed

+11
-22
lines changed

16 files changed

+11
-22
lines changed

rslib/src/backend/card_rendering.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ impl BackendCardRenderingService for Backend {
3434
request.speed,
3535
&request.text,
3636
)
37-
.map(Into::into)
3837
}
3938
}

rslib/src/backend/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ impl crate::services::ConfigService for Collection {
7777
) -> Result<()> {
7878
let val: Value = serde_json::from_slice(&input.value_json)?;
7979
self.transact_no_undo(|col| col.set_config(input.key.as_str(), &val).map(|_| ()))
80-
.map(Into::into)
8180
}
8281

8382
fn remove_config(

rslib/src/backend/import_export.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ impl BackendImportExportService for Backend {
1818
let mut guard = self.lock_open_collection()?;
1919

2020
let col_inner = guard.take().unwrap();
21-
col_inner
22-
.export_colpkg(input.out_path, input.include_media, input.legacy)
23-
.map(Into::into)
21+
col_inner.export_colpkg(input.out_path, input.include_media, input.legacy)
2422
}
2523

2624
fn import_collection_package(
@@ -36,6 +34,5 @@ impl BackendImportExportService for Backend {
3634
Path::new(&input.media_db),
3735
self.new_progress_handler(),
3836
)
39-
.map(Into::into)
4037
}
4138
}

rslib/src/backend/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl TryFrom<anki_proto::sync::SyncAuth> for SyncAuth {
9999
impl crate::services::BackendSyncService for Backend {
100100
fn sync_media(&self, input: anki_proto::sync::SyncAuth) -> Result<()> {
101101
let auth = input.try_into()?;
102-
self.sync_media_in_background(auth, None).map(Into::into)
102+
self.sync_media_in_background(auth, None)
103103
}
104104

105105
fn media_sync_status(&self) -> Result<MediaSyncStatusResponse> {

rslib/src/card/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl From<Card> for anki_proto::cards::Card {
131131
original_due: c.original_due,
132132
original_deck_id: c.original_deck_id.0,
133133
flags: c.flags as u32,
134-
original_position: c.original_position.map(Into::into),
134+
original_position: c.original_position,
135135
memory_state: c.memory_state.map(Into::into),
136136
desired_retention: c.desired_retention,
137137
custom_data: c.custom_data,

rslib/src/deckconfig/service.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ impl crate::services::DeckConfigService for Collection {
2121
col.add_or_update_deck_config_legacy(&mut conf)?;
2222
Ok(anki_proto::deck_config::DeckConfigId { dcid: conf.id.0 })
2323
})
24-
.map(Into::into)
2524
}
2625

2726
fn all_deck_config_legacy(&mut self) -> Result<generic::Json> {
@@ -62,7 +61,6 @@ impl crate::services::DeckConfigService for Collection {
6261

6362
fn remove_deck_config(&mut self, input: anki_proto::deck_config::DeckConfigId) -> Result<()> {
6463
self.transact_no_undo(|col| col.remove_deck_config_inner(input.into()))
65-
.map(Into::into)
6664
}
6765

6866
fn get_deck_configs_for_update(

rslib/src/scheduler/service/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl crate::services::SchedulerService for Collection {
5555
self.transact_no_undo(|col| {
5656
let today = col.current_due_day(0)?;
5757
let usn = col.usn()?;
58-
col.update_deck_stats(today, usn, input).map(Into::into)
58+
col.update_deck_stats(today, usn, input)
5959
})
6060
}
6161

@@ -70,7 +70,6 @@ impl crate::services::SchedulerService for Collection {
7070
input.new_delta,
7171
input.review_delta,
7272
)
73-
.map(Into::into)
7473
})
7574
}
7675

@@ -229,7 +228,6 @@ impl crate::services::SchedulerService for Collection {
229228

230229
fn upgrade_scheduler(&mut self) -> Result<()> {
231230
self.transact_no_undo(|col| col.upgrade_to_v2_scheduler())
232-
.map(Into::into)
233231
}
234232

235233
fn get_queued_cards(

rslib/src/search/service/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl crate::services::SearchService for Collection {
129129
&mut self,
130130
input: generic::Int64,
131131
) -> Result<anki_proto::search::BrowserRow> {
132-
self.browser_row_for_id(input.val).map(Into::into)
132+
self.browser_row_for_id(input.val)
133133
}
134134
}
135135

rslib/src/stats/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl crate::services::StatsService for Collection {
3434
&mut self,
3535
input: anki_proto::stats::GraphPreferences,
3636
) -> error::Result<()> {
37-
self.set_graph_preferences(input).map(Into::into)
37+
self.set_graph_preferences(input)
3838
}
3939
}
4040

rslib/src/storage/deck/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ impl SqliteStorage {
8282
.query_and_then([machine_name], row_to_deck)?
8383
.next()
8484
.transpose()
85-
.map_err(Into::into)
8685
}
8786

8887
pub(crate) fn get_all_decks(&self) -> Result<Vec<Deck>> {

rslib/src/storage/deckconfig/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ impl SqliteStorage {
6868
.query_and_then([name], |row| Ok::<_, AnkiError>(DeckConfigId(row.get(0)?)))?
6969
.next()
7070
.transpose()
71-
.map_err(Into::into)
7271
}
7372

7473
pub(crate) fn add_deck_conf(&self, conf: &mut DeckConfig) -> Result<()> {

rslib/src/storage/note/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl super::SqliteStorage {
280280
include_str!("get.sql"),
281281
" WHERE id IN (SELECT nid FROM search_nids)"
282282
))?
283-
.query_and_then([], |r| row_to_note(r).map_err(Into::into))?
283+
.query_and_then([], row_to_note)?
284284
.collect()
285285
}
286286

rslib/src/storage/revlog/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ impl SqliteStorage {
175175
pub(crate) fn get_all_revlog_entries(&self, after: TimestampSecs) -> Result<Vec<RevlogEntry>> {
176176
self.db
177177
.prepare_cached(concat!(include_str!("get.sql"), " where id >= ?"))?
178-
.query_and_then([after.0 * 1000], |r| row_to_revlog_entry(r).map(Into::into))?
178+
.query_and_then([after.0 * 1000], row_to_revlog_entry)?
179179
.collect()
180180
}
181181

rslib/src/storage/sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ fn schema_version(db: &Connection) -> Result<(bool, u8)> {
410410

411411
Ok((
412412
false,
413-
db.query_row("select ver from col", [], |r| r.get(0).map_err(Into::into))?,
413+
db.query_row("select ver from col", [], |r| r.get(0))?,
414414
))
415415
}
416416

rslib/src/sync/http_server/media_manager/upload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl ServerMediaManager {
7979
}
8080

8181
fn add_or_replace_file(path: &Path, data: Vec<u8>) -> error::Result<(), FileIoError> {
82-
write_file(path, data).map_err(Into::into)
82+
write_file(path, data)
8383
}
8484

8585
fn remove_file(path: &Path) -> error::Result<(), FileIoError> {

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
22
# older versions may fail to compile; newer versions may fail the clippy tests
3-
channel = "1.84.0"
3+
channel = "1.85.0"

0 commit comments

Comments
 (0)