translate the string for qr code

This commit is contained in:
Floris Bruynooghe
2023-02-14 12:07:02 +01:00
parent 323535584b
commit e1087b4145
4 changed files with 27 additions and 13 deletions

View File

@@ -167,9 +167,9 @@ pub async fn check_qr(context: &Context, qr: &str) -> Result<Qr> {
///
/// TODO: Refactor this so all variants have a correct [`Display`] and transform `check_qr`
/// into [`FromStr`].
pub fn format_backup(qr: Qr) -> Result<String> {
pub fn format_backup(qr: &Qr) -> Result<String> {
match qr {
Qr::Backup { ticket } => Ok(format!("{DCBACKUP_SCHEME}{ticket}")),
Qr::Backup { ref ticket } => Ok(format!("{DCBACKUP_SCHEME}{ticket}")),
_ => Err(anyhow!("Not a backup QR code")),
}
}