Skip to content

Commit 530c759

Browse files
committed
FullUserId: implement Display
1 parent eec27f3 commit 530c759

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

crates/cli/src/commands/syn2mas.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ impl Options {
200200
Ok(ExitCode::SUCCESS)
201201
}
202202
Subcommand::Migrate => {
203+
let provider_id_mappings: HashMap<String, Uuid> = HashMap::new();
203204
// TODO how should we handle warnings at this stage?
204205

205206
let mut reader = SynapseReader::new(&mut syn_conn, true).await?;
@@ -215,8 +216,14 @@ impl Options {
215216

216217
// TODO progress reporting
217218
let mas_matrix = MatrixConfig::extract(figment)?;
218-
syn2mas::migrate(&mut reader, &mut writer, &mas_matrix.homeserver, &mut rng)
219-
.await?;
219+
syn2mas::migrate(
220+
&mut reader,
221+
&mut writer,
222+
&mas_matrix.homeserver,
223+
&mut rng,
224+
&provider_id_mappings,
225+
)
226+
.await?;
220227

221228
reader.finish().await?;
222229
writer.finish().await?;

crates/syn2mas/src/synapse_reader/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
//! This module provides facilities for streaming relevant types of database
99
//! records from a Synapse database.
1010
11+
use std::fmt::Display;
12+
1113
use chrono::{DateTime, Utc};
1214
use futures_util::{Stream, TryStreamExt};
1315
use sqlx::{query, Acquire, FromRow, PgConnection, Postgres, Row, Transaction, Type};
@@ -30,6 +32,12 @@ pub enum Error {
3032
#[derive(Clone, Debug, sqlx::Decode, PartialEq, Eq, PartialOrd, Ord)]
3133
pub struct FullUserId(pub String);
3234

35+
impl Display for FullUserId {
36+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37+
self.0.fmt(f)
38+
}
39+
}
40+
3341
impl Type<Postgres> for FullUserId {
3442
fn type_info() -> <sqlx::Postgres as sqlx::Database>::TypeInfo {
3543
<String as Type<Postgres>>::type_info()

0 commit comments

Comments
 (0)