|
25 | 25 |
|
26 | 26 | // Proc-macro2 types in rustdoc of other crates get linked to here. |
27 | 27 | #![doc(html_root_url = "https://docs.rs/proc-macro2/0.3.1")] |
28 | | - |
29 | 28 | #![cfg_attr(feature = "nightly", feature(proc_macro))] |
30 | 29 |
|
31 | 30 | #[cfg(feature = "proc-macro")] |
@@ -83,8 +82,9 @@ impl FromStr for TokenStream { |
83 | 82 | type Err = LexError; |
84 | 83 |
|
85 | 84 | fn from_str(src: &str) -> Result<TokenStream, LexError> { |
86 | | - let e = src.parse().map_err(|e| { |
87 | | - LexError { inner: e, _marker: marker::PhantomData } |
| 85 | + let e = src.parse().map_err(|e| LexError { |
| 86 | + inner: e, |
| 87 | + _marker: marker::PhantomData, |
88 | 88 | })?; |
89 | 89 | Ok(TokenStream::_new(e)) |
90 | 90 | } |
@@ -219,14 +219,20 @@ impl Span { |
219 | 219 |
|
220 | 220 | #[cfg(procmacro2_semver_exempt)] |
221 | 221 | pub fn start(&self) -> LineColumn { |
222 | | - let imp::LineColumn{ line, column } = self.inner.start(); |
223 | | - LineColumn { line: line, column: column } |
| 222 | + let imp::LineColumn { line, column } = self.inner.start(); |
| 223 | + LineColumn { |
| 224 | + line: line, |
| 225 | + column: column, |
| 226 | + } |
224 | 227 | } |
225 | 228 |
|
226 | 229 | #[cfg(procmacro2_semver_exempt)] |
227 | 230 | pub fn end(&self) -> LineColumn { |
228 | | - let imp::LineColumn{ line, column } = self.inner.end(); |
229 | | - LineColumn { line: line, column: column } |
| 231 | + let imp::LineColumn { line, column } = self.inner.end(); |
| 232 | + LineColumn { |
| 233 | + line: line, |
| 234 | + column: column, |
| 235 | + } |
230 | 236 | } |
231 | 237 |
|
232 | 238 | #[cfg(procmacro2_semver_exempt)] |
@@ -559,16 +565,15 @@ pub mod token_stream { |
559 | 565 | use std::marker; |
560 | 566 | use std::rc::Rc; |
561 | 567 |
|
562 | | - use imp; |
563 | | - use TokenTree; |
564 | 568 | pub use TokenStream; |
| 569 | + use TokenTree; |
| 570 | + use imp; |
565 | 571 |
|
566 | 572 | pub struct IntoIter { |
567 | 573 | inner: imp::TokenTreeIter, |
568 | 574 | _marker: marker::PhantomData<Rc<()>>, |
569 | 575 | } |
570 | 576 |
|
571 | | - |
572 | 577 | impl Iterator for IntoIter { |
573 | 578 | type Item = TokenTree; |
574 | 579 |
|
|
0 commit comments