From f690599f9ed6b2efae5ea31ec25be0bc3012bea5 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 24 Sep 2020 23:21:54 +0200 Subject: [PATCH] config: update tests --- src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 6f8c31c..7d555da 100644 --- a/src/config.rs +++ b/src/config.rs @@ -197,7 +197,7 @@ mod test { }; let mut buffer = [0; EEPROM_SIZE]; - let buffer = config.encode(&mut buffer).unwrap(); + let buffer = to_slice(&config, &mut buffer).unwrap(); assert!(buffer.len() <= EEPROM_SIZE); } @@ -222,8 +222,8 @@ mod test { }; let mut buffer = [0; EEPROM_SIZE]; - config.encode(&mut buffer).unwrap(); - let decoded = Config::decode(&buffer).unwrap(); + to_slice(&config, &mut buffer).unwrap(); + let decoded: Config = from_bytes(&buffer).unwrap(); assert_eq!(decoded, config); } }