@@ -6524,7 +6524,6 @@ fn variant_available_device_type_js_to_rs<'a>(
65246524 }
65256525 "AvailableDeviceTypePassword" => Ok(libparsec::AvailableDeviceType::Password {}),
65266526 "AvailableDeviceTypeRecovery" => Ok(libparsec::AvailableDeviceType::Recovery {}),
6527- "AvailableDeviceTypeSmartcard" => Ok(libparsec::AvailableDeviceType::Smartcard {}),
65286527 _ => cx.throw_type_error("Object is not a AvailableDeviceType"),
65296528 }
65306529}
@@ -6574,10 +6573,6 @@ fn variant_available_device_type_rs_to_js<'a>(
65746573 let js_tag = JsString::try_new(cx, "AvailableDeviceTypeRecovery").or_throw(cx)?;
65756574 js_obj.set(cx, "tag", js_tag)?;
65766575 }
6577- libparsec::AvailableDeviceType::Smartcard { .. } => {
6578- let js_tag = JsString::try_new(cx, "AvailableDeviceTypeSmartcard").or_throw(cx)?;
6579- js_obj.set(cx, "tag", js_tag)?;
6580- }
65816576 }
65826577 Ok(js_obj)
65836578}
@@ -9405,20 +9400,6 @@ fn variant_device_access_strategy_js_to_rs<'a>(
94059400 };
94069401 Ok(libparsec::DeviceAccessStrategy::Password { password, key_file })
94079402 }
9408- "DeviceAccessStrategySmartcard" => {
9409- let key_file = {
9410- let js_val: Handle<JsString> = obj.get(cx, "keyFile")?;
9411- {
9412- let custom_from_rs_string =
9413- |s: String| -> Result<_, &'static str> { Ok(std::path::PathBuf::from(s)) };
9414- match custom_from_rs_string(js_val.value(cx)) {
9415- Ok(val) => val,
9416- Err(err) => return cx.throw_type_error(err),
9417- }
9418- }
9419- };
9420- Ok(libparsec::DeviceAccessStrategy::Smartcard { key_file })
9421- }
94229403 _ => cx.throw_type_error("Object is not a DeviceAccessStrategy"),
94239404 }
94249405}
@@ -9541,23 +9522,6 @@ fn variant_device_access_strategy_rs_to_js<'a>(
95419522 .or_throw(cx)?;
95429523 js_obj.set(cx, "keyFile", js_key_file)?;
95439524 }
9544- libparsec::DeviceAccessStrategy::Smartcard { key_file, .. } => {
9545- let js_tag = JsString::try_new(cx, "DeviceAccessStrategySmartcard").or_throw(cx)?;
9546- js_obj.set(cx, "tag", js_tag)?;
9547- let js_key_file = JsString::try_new(cx, {
9548- let custom_to_rs_string = |path: std::path::PathBuf| -> Result<_, _> {
9549- path.into_os_string()
9550- .into_string()
9551- .map_err(|_| "Path contains non-utf8 characters")
9552- };
9553- match custom_to_rs_string(key_file) {
9554- Ok(ok) => ok,
9555- Err(err) => return cx.throw_type_error(err.to_string()),
9556- }
9557- })
9558- .or_throw(cx)?;
9559- js_obj.set(cx, "keyFile", js_key_file)?;
9560- }
95619525 }
95629526 Ok(js_obj)
95639527}
@@ -9635,15 +9599,6 @@ fn variant_device_save_strategy_js_to_rs<'a>(
96359599 };
96369600 Ok(libparsec::DeviceSaveStrategy::Password { password })
96379601 }
9638- "DeviceSaveStrategySmartcard" => {
9639- let certificate_reference = {
9640- let js_val: Handle<JsObject> = obj.get(cx, "certificateReference")?;
9641- struct_x509_certificate_reference_js_to_rs(cx, js_val)?
9642- };
9643- Ok(libparsec::DeviceSaveStrategy::Smartcard {
9644- certificate_reference,
9645- })
9646- }
96479602 _ => cx.throw_type_error("Object is not a DeviceSaveStrategy"),
96489603 }
96499604}
@@ -9703,16 +9658,6 @@ fn variant_device_save_strategy_rs_to_js<'a>(
97039658 let js_password = JsString::try_new(cx, password).or_throw(cx)?;
97049659 js_obj.set(cx, "password", js_password)?;
97059660 }
9706- libparsec::DeviceSaveStrategy::Smartcard {
9707- certificate_reference,
9708- ..
9709- } => {
9710- let js_tag = JsString::try_new(cx, "DeviceSaveStrategySmartcard").or_throw(cx)?;
9711- js_obj.set(cx, "tag", js_tag)?;
9712- let js_certificate_reference =
9713- struct_x509_certificate_reference_rs_to_js(cx, certificate_reference)?;
9714- js_obj.set(cx, "certificateReference", js_certificate_reference)?;
9715- }
97169661 }
97179662 Ok(js_obj)
97189663}
0 commit comments