Skip to content
This repository was archived by the owner on Oct 6, 2024. It is now read-only.

Commit 297bceb

Browse files
committed
Don't confuse :: with beginning of a case conversion
1 parent 11ceffe commit 297bceb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/attr.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::error::Result;
22
use crate::segment::{self, Segment};
3-
use proc_macro::{Delimiter, Group, Span, TokenStream, TokenTree};
3+
use proc_macro::{Delimiter, Group, Spacing, Span, TokenStream, TokenTree};
44
use std::iter;
55
use std::mem;
66
use std::str::FromStr;
@@ -157,6 +157,8 @@ fn is_stringlike(token: &TokenTree) -> bool {
157157
None => false,
158158
}
159159
}
160-
TokenTree::Punct(punct) => punct.as_char() == '\'' || punct.as_char() == ':',
160+
TokenTree::Punct(punct) => {
161+
punct.as_char() == '\'' || punct.as_char() == ':' && punct.spacing() == Spacing::Alone
162+
}
161163
}
162164
}

0 commit comments

Comments
 (0)