Skip to content

Commit

Permalink
Merge pull request #45 from taks/uncheck-utf8
Browse files Browse the repository at this point in the history
Changed to accept invalid ut8 string.
  • Loading branch information
taks authored Nov 16, 2023
2 parents 217ef0d + ba05d5c commit f25dfbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/ble_advertised_device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl BLEAdvertisedDevice {
self.ad_flag = Some(data[0]);
}
esp_idf_sys::BLE_HS_ADV_TYPE_INCOMP_NAME | esp_idf_sys::BLE_HS_ADV_TYPE_COMP_NAME => {
self.name = String::from_utf8(data.to_vec()).unwrap();
self.name = unsafe { String::from_utf8_unchecked(data.to_vec()) };
}
esp_idf_sys::BLE_HS_ADV_TYPE_TX_PWR_LVL => {
self.tx_power = Some(data[0]);
Expand Down

0 comments on commit f25dfbd

Please sign in to comment.