Skip to content

Commit b9e29b6

Browse files
Vaibhav DevmurariAndroid (Google) Code Review
authored andcommitted
Merge "Correctly convert std::string to rust::String" into main
2 parents 8c3e268 + 31b9016 commit b9e29b6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

libs/input/KeyboardClassifier.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ void KeyboardClassifier::notifyKeyboardChanged(DeviceId deviceId,
5757
uint32_t deviceClasses) {
5858
if (mRustClassifier) {
5959
RustInputDeviceIdentifier rustIdentifier;
60-
rustIdentifier.name = identifier.name;
61-
rustIdentifier.location = identifier.location;
62-
rustIdentifier.unique_id = identifier.uniqueId;
60+
rustIdentifier.name = rust::String::lossy(identifier.name);
61+
rustIdentifier.location = rust::String::lossy(identifier.location);
62+
rustIdentifier.unique_id = rust::String::lossy(identifier.uniqueId);
6363
rustIdentifier.bus = identifier.bus;
6464
rustIdentifier.vendor = identifier.vendor;
6565
rustIdentifier.product = identifier.product;
6666
rustIdentifier.version = identifier.version;
67-
rustIdentifier.descriptor = identifier.descriptor;
67+
rustIdentifier.descriptor = rust::String::lossy(identifier.descriptor);
6868
android::input::keyboardClassifier::notifyKeyboardChanged(**mRustClassifier, deviceId,
6969
rustIdentifier, deviceClasses);
7070
} else {

0 commit comments

Comments
 (0)