Conversation
|
The only thing I see is that we should clean out the warnings this generates prior to submission. |
src/whiteflag/wf_codec/encoding.rs
Outdated
| encode_bdx(remove_all_invalid_hex_characters(value)) | ||
| } | ||
| EncodingKind::LAT | EncodingKind::LONG => encode_latlong(value), | ||
| _ => vec![0], |
There was a problem hiding this comment.
@Romulus10 only reason I added this is because that is what was in the java codebase
| } */ | ||
| let value = &data[index]; | ||
| field.set(value.as_ref()); | ||
| field.set(value.as_ref()).unwrap(); |
There was a problem hiding this comment.
@Romulus10 I haven't fleshed out the error handling -- I began adding it to one or two functions but decided it could wait -- more functions need their outputs changed to handle errors and I can also add unit tests to make sure the errors are being triggered properly -- but I didn't think we needed to worry about that for M3
| self.subject_code.clone() | ||
| } | ||
| pub fn set_subject_code(&mut self, arg: String) -> bool { | ||
| if self.subject_code == "" { |
There was a problem hiding this comment.
would be good to make the fields that can be nothing Option<>'s for the rusty version
There was a problem hiding this comment.
correct -- there is a lot of work to do in this codebase to make it conform to idiomatic rust
I am not even sure we need all these get() and set() methods as they are more of a java convention
| (buffer, len) | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
be nice to make the comments rust style
https://doc.rust-lang.org/reference/comments.html
https://doc.rust-lang.org/rust-by-example/meta/doc.html
There was a problem hiding this comment.
Yes, given the proximity to the deadline, I did not focus on reformatting the comments. That is on the to-do list.
| body.decode(&buffer, bit_length, bit_cursor, 0); | ||
| //bit_cursor += header.bit_length(); | ||
| //next_field = body.fields.len(); | ||
|
|
There was a problem hiding this comment.
edge cases for Q and T message codes need to be ported (see below java method for implementation)
this code contains the essentials needed for encoding and decoding a whiteflag authentication message according to version 1 of the whiteflag protocol
a few notes