-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
54 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
my-grpc-server-macros/src/generate_server_stream/generate_server_stream.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
use proc_macro::TokenStream; | ||
use types_reader::TokensObject; | ||
|
||
pub fn generate_server_stream(tokens: TokenStream) -> Result<TokenStream, syn::Error> { | ||
let params_list = types_reader::ParamsList::new(tokens.into(), || None)?; | ||
let tokens: proc_macro2::TokenStream = tokens.into(); | ||
let params_list = TokensObject::new(tokens.into())?; | ||
|
||
let stream_name = params_list.get_named_param("stream_name")?; | ||
let stream_name: &str = params_list.get_named_param("stream_name")?.try_into()?; | ||
|
||
let item_name = params_list.get_named_param("item_name")?; | ||
let item_name: &str = params_list.get_named_param("item_name")?.try_into()?; | ||
|
||
Ok(crate::generate_stream::generate_stream( | ||
stream_name.unwrap_as_string_value()?.as_str(), | ||
item_name.unwrap_as_string_value()?.as_str(), | ||
) | ||
.into()) | ||
Ok(crate::generate_stream::generate_stream(stream_name, item_name).into()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters