webdriver: Simplify deserialize window_handles: Vec<String> (#38838)

We don't need to serialize internal String and then serialize the Result
type.

Testing: Tested. No behaviour change.

Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
Euclid Ye 2025-08-22 12:34:43 +08:00 committed by GitHub
parent cd5226adc2
commit 66b0eb2687
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1067,11 +1067,6 @@ impl Handler {
let mut handles = self.get_window_handles()?; let mut handles = self.get_window_handles()?;
handles.sort(); handles.sort();
let handles = handles
.into_iter()
.map(serde_json::to_value)
.collect::<Result<Vec<_>, _>>()?;
Ok(WebDriverResponse::Generic(ValueResponse( Ok(WebDriverResponse::Generic(ValueResponse(
serde_json::to_value(handles)?, serde_json::to_value(handles)?,
))) )))