feat: add a field.id

This commit is contained in:
2024-08-02 23:02:21 +02:00
parent 4d004afc5e
commit 9126d1311b
2 changed files with 8 additions and 3 deletions

View File

@ -82,8 +82,8 @@ pub fn lire_carte(code_pin: &str, lecteur: &str) -> Result<CartePS, String> {
fn decode_carte_ps(groups: Vec<Block>) -> Result<CartePS, String> {
let mut carte_ps = CartePS::default();
for group in groups {
for (field_index, field) in group.content.iter().enumerate() {
match (group.id, field_index + 1) {
for field in group.content {
match (group.id, field.id) {
(1, 1) => {
carte_ps.titulaire.type_de_carte_ps =
String::from_utf8_lossy(field.content).to_string();