Rename Group::to_bytes() into Group::to_arr(),

This brings the `Group` and `SizedBytes` traits into some sort of name
coherence (they both return a GenericArray). This also uses
`&my_generic_array[..]` (i.e. the `Deref` impl) over
`my_generic_array.as_slice()`.
This commit is contained in:
François Garillot
2020-07-03 17:30:32 -04:00
parent 3e41f2441d
commit bb9c365998
4 changed files with 19 additions and 28 deletions
+2 -2
View File
@@ -85,7 +85,7 @@ fn server_registration_roundtrip() {
#[test]
fn register_first_message_roundtrip() {
let pt = random_ristretto_point();
let pt_bytes = pt.to_bytes();
let pt_bytes = pt.to_arr();
let r1 = RegisterFirstMessage::<RistrettoPoint>::try_from(pt_bytes.as_slice()).unwrap();
let r1_bytes = r1.to_bytes();
assert_eq!(pt_bytes, r1_bytes);
@@ -94,7 +94,7 @@ fn register_first_message_roundtrip() {
#[test]
fn register_second_message_roundtrip() {
let pt = random_ristretto_point();
let pt_bytes = pt.to_bytes();
let pt_bytes = pt.to_arr();
let message = pt_bytes.to_vec();
let r2 = RegisterSecondMessage::<RistrettoPoint>::try_from(&message[..]).unwrap();