提交 da438458 编写于 作者: H Huon Wilson

lint: make the non_camel_case_types lint work with scripts without a upper/lowercase distinction.

上级 07feeb95
......@@ -854,7 +854,10 @@ fn is_camel_case(cx: ty::ctxt, ident: ast::ident) -> bool {
let ident = cx.sess.str_of(ident);
assert!(!ident.is_empty());
let ident = ident.trim_chars(&'_');
char::is_uppercase(ident.char_at(0)) &&
// start with a non-lowercase letter rather than non-uppercase
// ones (some scripts don't have a concept of upper/lowercase)
!ident.char_at(0).is_lowercase() &&
!ident.contains_char('_')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册