about summary refs log tree commit diff
path: root/src/libserialize
diff options
context:
space:
mode:
authorP1start <rewi-github@whanau.org>2014-07-19 00:45:17 +1200
committerP1start <rewi-github@whanau.org>2014-08-30 09:10:05 +1200
commitde7abd88244a9fe7033cb71e22af0601d1b811b9 (patch)
tree0f57eaeba2ecc2d72a618872a7e06885d5e611db /src/libserialize
parentbd159d3867473ee43959706519066531d76af7ba (diff)
Unify non-snake-case lints and non-uppercase statics lints
This unifies the `non_snake_case_functions` and `uppercase_variables` lints
into one lint, `non_snake_case`. It also now checks for non-snake-case modules.
This also extends the non-camel-case types lint to check type parameters, and
merges the `non_uppercase_pattern_statics` lint into the
`non_uppercase_statics` lint.

Because the `uppercase_variables` lint is now part of the `non_snake_case`
lint, all non-snake-case variables that start with lowercase characters (such
as `fooBar`) will now trigger the `non_snake_case` lint.

New code should be updated to use the new `non_snake_case` lint instead of the
previous `non_snake_case_functions` and `uppercase_variables` lints. All use of
the `non_uppercase_pattern_statics` should be replaced with the
`non_uppercase_statics` lint. Any code that previously contained non-snake-case
module or variable names should be updated to use snake case names or disable
the `non_snake_case` lint. Any code with non-camel-case type parameters should
be changed to use camel case or disable the `non_camel_case_types` lint.

[breaking-change]
Diffstat (limited to 'src/libserialize')
-rw-r--r--src/libserialize/json.rs2
-rw-r--r--src/libserialize/serialize.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index d70b6b4d57b..b37b4588af6 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -2282,7 +2282,7 @@ macro_rules! tuple_impl {
             > ToJson for ( $( $tyvar ),* , ) {
 
             #[inline]
-            #[allow(uppercase_variables)]
+            #[allow(non_snake_case)]
             fn to_json(&self) -> Json {
                 match *self {
                     ($(ref $tyvar),*,) => List(vec![$($tyvar.to_json()),*])
diff --git a/src/libserialize/serialize.rs b/src/libserialize/serialize.rs
index bbaac7a96e9..2cda00ad6c4 100644
--- a/src/libserialize/serialize.rs
+++ b/src/libserialize/serialize.rs
@@ -481,7 +481,7 @@ macro_rules! tuple (
     () => ();
     ( $($name:ident,)+ ) => (
         impl<E, D:Decoder<E>,$($name:Decodable<D, E>),*> Decodable<D,E> for ($($name,)*) {
-            #[allow(uppercase_variables)]
+            #[allow(non_snake_case)]
             fn decode(d: &mut D) -> Result<($($name,)*), E> {
                 d.read_tuple(|d, amt| {
                     let mut i = 0;
@@ -496,7 +496,7 @@ macro_rules! tuple (
             }
         }
         impl<E, S:Encoder<E>,$($name:Encodable<S, E>),*> Encodable<S, E> for ($($name,)*) {
-            #[allow(uppercase_variables)]
+            #[allow(non_snake_case)]
             fn encode(&self, s: &mut S) -> Result<(), E> {
                 let ($(ref $name,)*) = *self;
                 let mut n = 0;