Skip to content

Commit

Permalink
Merge branch 'release/v0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Frodo45127 committed Dec 18, 2017
2 parents 9e16e12 + d3fa920 commit dc797f4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/common/coding_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,16 @@ pub fn decode_float_u32(float_encoded: Vec<u8>) -> f32 {
/// This function allow us to decode an UTF-8 encoded String.
#[allow(dead_code)]
pub fn decode_string_u8(string_encoded: Vec<u8>) -> String {
let string_decoded = String::from_utf8(string_encoded).unwrap();
let string_decoded: String;
let string_decoded_result = String::from_utf8(string_encoded);
match string_decoded_result {
Ok(string_decoded_result) => {
string_decoded = string_decoded_result;
}
Err(e) => {
string_decoded = format!("Error decoding String.")
}
}
string_decoded
}

Expand Down

0 comments on commit dc797f4

Please sign in to comment.