Skip to content

Commit 34928d9

Browse files
TimTheBigoli-obk
andcommitted
Apply suggestions from code review
Co-authored-by: Oli Scherer <[email protected]>
1 parent 9f3783a commit 34928d9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

library/proc_macro/src/bridge/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(super) struct Closure<'a, A, R> {
1717
struct Env;
1818

1919
impl<'a, A, R, F: FnMut(A) -> R> From<&'a mut F> for Closure<'a, A, R> {
20-
/// Create a `Closure` from a function
20+
/// Create a `Closure` from an `FnMut` eg.(function, `||` closure)
2121
fn from(f: &'a mut F) -> Self {
2222
unsafe extern "C" fn call<A, R, F: FnMut(A) -> R>(env: *mut Env, arg: A) -> R {
2323
unsafe { (*(env as *mut _ as *mut F))(arg) }

library/proc_macro/src/bridge/rpc.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub enum PanicMessage {
253253
}
254254

255255
impl From<Box<dyn Any + Send>> for PanicMessage {
256-
/// downcast the payload and wrap it in `StaticStr` or `String`.
256+
/// Extract `String` or `&'static str` payloads if available or default to `Unknown`
257257
fn from(payload: Box<dyn Any + Send + 'static>) -> Self {
258258
if let Some(s) = payload.downcast_ref::<&'static str>() {
259259
return PanicMessage::StaticStr(s);
@@ -266,7 +266,7 @@ impl From<Box<dyn Any + Send>> for PanicMessage {
266266
}
267267

268268
impl From<PanicMessage> for Box<dyn Any + Send> {
269-
/// Return the inner wrapped in `Box`.
269+
/// Return the inner message wrapped in `Box`.
270270
///
271271
/// ## Cost
272272
/// Allocates a new `Box` on the heap

library/proc_macro/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn tree_to_bridge_tree(
238238
/// Creates a token stream containing a single token tree.
239239
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
240240
impl From<TokenTree> for TokenStream {
241-
/// Convert the tree to a bridge tree then a `TokenStream`
241+
/// Convert the tree to a `TokenStream`
242242
fn from(tree: TokenTree) -> TokenStream {
243243
TokenStream(Some(bridge::client::TokenStream::from_token_tree(tree_to_bridge_tree(tree))))
244244
}

0 commit comments

Comments
 (0)