Skip to content

Commit

Permalink
Changed to accept invalid ut8 string.
Browse files Browse the repository at this point in the history
  • Loading branch information
taks committed Nov 16, 2023
1 parent 217ef0d commit ba05d5c
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 ba05d5c

Please sign in to comment.