diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..c1614235c4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*.rs] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +tab_width = 4 diff --git a/core/http/src/header/content_coding.rs b/core/http/src/header/content_coding.rs index 135da33385..a4b175aff3 100644 --- a/core/http/src/header/content_coding.rs +++ b/core/http/src/header/content_coding.rs @@ -65,22 +65,22 @@ macro_rules! content_codings { #[allow(non_upper_case_globals)] pub const $name: ContentCoding = ContentCoding::new_known( $c, - $c, + $c, None, ); )+ - + /// Returns `true` if this ContentCoding is known to Rocket. In other words, /// returns `true` if there is an associated constant for `self`. pub fn is_known(&self) -> bool { if let Source::Known(_) = self.source { return true; } - + $(if self.$check() { return true })+ false } - + $( /// Returns `true` if the top-level and sublevel types of /// `self` are the same as those of diff --git a/core/http/src/header/known_content_codings.rs b/core/http/src/header/known_content_codings.rs index f8ee6b2f20..a12bcc67e2 100644 --- a/core/http/src/header/known_content_codings.rs +++ b/core/http/src/header/known_content_codings.rs @@ -3,7 +3,8 @@ macro_rules! known_content_codings { Any (is_any): "any content coding", "*", // BR (is_br): "Brotli Compressed Data Format", "br", // COMPRESS (is_compress): "UNIX \"compress\" data format", "compress", - // DEFLATE (is_deflate): "\"deflate\" compressed data inside the \"zlib\" data format", "deflate", + // DEFLATE (is_deflate): "\"deflate\" compressed data inside the \"zlib\" + // data format", "deflate", GZIP (is_gzip): "GZIP file format", "gzip", IDENTITY (is_identity): "Reserved", "identity", }) diff --git a/core/http/src/parse/content_coding.rs b/core/http/src/parse/content_coding.rs index b96c85821f..7b359d44f0 100644 --- a/core/http/src/parse/content_coding.rs +++ b/core/http/src/parse/content_coding.rs @@ -110,7 +110,7 @@ mod test { fn check_params_do_parse() { assert_parse!("*; q=1"); } - + #[test] fn test_bad_parses() { assert_no_parse!("*; q=1;");