Skip to content

Commit 9f3b35a

Browse files
committed
Fixed warnings
1 parent 9abdbdf commit 9f3b35a

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

src/desktop.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ pub struct Iap<R: Runtime>(AppHandle<R>);
1515

1616
impl<R: Runtime> Iap<R> {
1717
pub fn initialize(&self) -> crate::Result<InitializeResponse> {
18-
Err(crate::Error::from(std::io::Error::new(
19-
std::io::ErrorKind::Other,
18+
Err(crate::Error::from(std::io::Error::other(
2019
"IAP is not supported on this platform",
2120
)))
2221
}
@@ -26,8 +25,7 @@ impl<R: Runtime> Iap<R> {
2625
_product_ids: Vec<String>,
2726
_product_type: String,
2827
) -> crate::Result<GetProductsResponse> {
29-
Err(crate::Error::from(std::io::Error::new(
30-
std::io::ErrorKind::Other,
28+
Err(crate::Error::from(std::io::Error::other(
3129
"IAP is not supported on this platform",
3230
)))
3331
}
@@ -38,8 +36,7 @@ impl<R: Runtime> Iap<R> {
3836
_product_type: String,
3937
_offer_token: Option<String>,
4038
) -> crate::Result<Purchase> {
41-
Err(crate::Error::from(std::io::Error::new(
42-
std::io::ErrorKind::Other,
39+
Err(crate::Error::from(std::io::Error::other(
4340
"IAP is not supported on this platform",
4441
)))
4542
}
@@ -48,15 +45,13 @@ impl<R: Runtime> Iap<R> {
4845
&self,
4946
_product_type: String,
5047
) -> crate::Result<RestorePurchasesResponse> {
51-
Err(crate::Error::from(std::io::Error::new(
52-
std::io::ErrorKind::Other,
48+
Err(crate::Error::from(std::io::Error::other(
5349
"IAP is not supported on this platform",
5450
)))
5551
}
5652

5753
pub fn get_purchase_history(&self) -> crate::Result<GetPurchaseHistoryResponse> {
58-
Err(crate::Error::from(std::io::Error::new(
59-
std::io::ErrorKind::Other,
54+
Err(crate::Error::from(std::io::Error::other(
6055
"IAP is not supported on this platform",
6156
)))
6257
}
@@ -65,8 +60,7 @@ impl<R: Runtime> Iap<R> {
6560
&self,
6661
_purchase_token: String,
6762
) -> crate::Result<AcknowledgePurchaseResponse> {
68-
Err(crate::Error::from(std::io::Error::new(
69-
std::io::ErrorKind::Other,
63+
Err(crate::Error::from(std::io::Error::other(
7064
"IAP is not supported on this platform",
7165
)))
7266
}
@@ -76,8 +70,7 @@ impl<R: Runtime> Iap<R> {
7670
_product_id: String,
7771
_product_type: String,
7872
) -> crate::Result<ProductStatus> {
79-
Err(crate::Error::from(std::io::Error::new(
80-
std::io::ErrorKind::Other,
73+
Err(crate::Error::from(std::io::Error::other(
8174
"IAP is not supported on this platform",
8275
)))
8376
}

src/models.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ impl<'de> Deserialize<'de> for PurchaseStateValue {
159159
1 => Ok(PurchaseStateValue::Canceled),
160160
2 => Ok(PurchaseStateValue::Pending),
161161
_ => Err(serde::de::Error::custom(format!(
162-
"Invalid purchase state: {}",
163-
value
162+
"Invalid purchase state: {value}"
164163
))),
165164
}
166165
}

0 commit comments

Comments
 (0)