Skip to content

Commit 242d296

Browse files
medwardsbjgill
authored andcommitted
Idiomatic Rust returns for Error conversions (#2812)
* Idiomatic Rust returns for Error conversions * Regenerate Rust samples
1 parent a864ae9 commit 242d296

File tree

26 files changed

+32
-32
lines changed

26 files changed

+32
-32
lines changed

modules/openapi-generator/src/main/resources/rust/reqwest/api_mod.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ pub enum Error {
1010

1111
impl From<reqwest::Error> for Error {
1212
fn from(e: reqwest::Error) -> Self {
13-
return Error::Reqwest(e)
13+
Error::Reqwest(e)
1414
}
1515
}
1616

1717
impl From<serde_json::Error> for Error {
1818
fn from(e: serde_json::Error) -> Self {
19-
return Error::Serde(e)
19+
Error::Serde(e)
2020
}
2121
}
2222

2323
impl From<std::io::Error> for Error {
2424
fn from(e: std::io::Error) -> Self {
25-
return Error::Io(e)
25+
Error::Io(e)
2626
}
2727
}
2828

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.0-SNAPSHOT
1+
4.0.2-SNAPSHOT

samples/client/petstore/rust-reqwest/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Creates list of users with given input array
5555

5656
Name | Type | Description | Notes
5757
------------- | ------------- | ------------- | -------------
58-
**body** | [**Vec<::models::User>**](array.md)| List of user object |
58+
**body** | [**Vec<::models::User>**](User.md)| List of user object |
5959

6060
### Return type
6161

@@ -83,7 +83,7 @@ Creates list of users with given input array
8383

8484
Name | Type | Description | Notes
8585
------------- | ------------- | ------------- | -------------
86-
**body** | [**Vec<::models::User>**](array.md)| List of user object |
86+
**body** | [**Vec<::models::User>**](User.md)| List of user object |
8787

8888
### Return type
8989

samples/client/petstore/rust-reqwest/src/apis/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/apis/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ pub enum Error {
1010

1111
impl From<reqwest::Error> for Error {
1212
fn from(e: reqwest::Error) -> Self {
13-
return Error::Reqwest(e)
13+
Error::Reqwest(e)
1414
}
1515
}
1616

1717
impl From<serde_json::Error> for Error {
1818
fn from(e: serde_json::Error) -> Self {
19-
return Error::Serde(e)
19+
Error::Serde(e)
2020
}
2121
}
2222

2323
impl From<std::io::Error> for Error {
2424
fn from(e: std::io::Error) -> Self {
25-
return Error::Io(e)
25+
Error::Io(e)
2626
}
2727
}
2828

samples/client/petstore/rust-reqwest/src/apis/pet_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/apis/store_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/apis/user_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/models/api_response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/models/category.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/models/order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/models/pet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/models/tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust-reqwest/src/models/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.0-SNAPSHOT
1+
4.0.2-SNAPSHOT

samples/client/petstore/rust/docs/UserApi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Creates list of users with given input array
5555

5656
Name | Type | Description | Notes
5757
------------- | ------------- | ------------- | -------------
58-
**body** | [**Vec<::models::User>**](array.md)| List of user object |
58+
**body** | [**Vec<::models::User>**](User.md)| List of user object |
5959

6060
### Return type
6161

@@ -83,7 +83,7 @@ Creates list of users with given input array
8383

8484
Name | Type | Description | Notes
8585
------------- | ------------- | ------------- | -------------
86-
**body** | [**Vec<::models::User>**](array.md)| List of user object |
86+
**body** | [**Vec<::models::User>**](User.md)| List of user object |
8787

8888
### Return type
8989

samples/client/petstore/rust/src/apis/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/apis/pet_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/apis/store_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/apis/user_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/models/api_response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/models/category.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/models/order.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/models/pet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/models/tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

samples/client/petstore/rust/src/models/user.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
55
*
6-
* OpenAPI spec version: 1.0.0
6+
* The version of the OpenAPI document: 1.0.0
77
*
88
* Generated by: https://openapi-generator.tech
99
*/

0 commit comments

Comments
 (0)