style(headers): Break lines with over 100 characters
This commit is contained in:
		| @@ -167,15 +167,19 @@ mod tests { | ||||
|  | ||||
|     #[test] | ||||
|     fn test_raw_auth_parse() { | ||||
|         let header: Authorization<String> = Header::parse_header(&[b"foo bar baz".to_vec()]).unwrap(); | ||||
|         let header: Authorization<String> = Header::parse_header( | ||||
|             &[b"foo bar baz".to_vec()]).unwrap(); | ||||
|         assert_eq!(header.0, "foo bar baz"); | ||||
|     } | ||||
|  | ||||
|     #[test] | ||||
|     fn test_basic_auth() { | ||||
|         let mut headers = Headers::new(); | ||||
|         headers.set(Authorization(Basic { username: "Aladdin".to_string(), password: Some("open sesame".to_string()) })); | ||||
|         assert_eq!(headers.to_string(), "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\r\n".to_string()); | ||||
|         headers.set(Authorization( | ||||
|             Basic { username: "Aladdin".to_string(), password: Some("open sesame".to_string()) })); | ||||
|         assert_eq!( | ||||
|             headers.to_string(), | ||||
|             "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==\r\n".to_string()); | ||||
|     } | ||||
|  | ||||
|     #[test] | ||||
| @@ -187,14 +191,16 @@ mod tests { | ||||
|  | ||||
|     #[test] | ||||
|     fn test_basic_auth_parse() { | ||||
|         let auth: Authorization<Basic> = Header::parse_header(&[b"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==".to_vec()]).unwrap(); | ||||
|         let auth: Authorization<Basic> = Header::parse_header( | ||||
|             &[b"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==".to_vec()]).unwrap(); | ||||
|         assert_eq!(auth.0.username, "Aladdin"); | ||||
|         assert_eq!(auth.0.password, Some("open sesame".to_string())); | ||||
|     } | ||||
|  | ||||
|     #[test] | ||||
|     fn test_basic_auth_parse_no_password() { | ||||
|         let auth: Authorization<Basic> = Header::parse_header(&[b"Basic QWxhZGRpbjo=".to_vec()]).unwrap(); | ||||
|         let auth: Authorization<Basic> = Header::parse_header( | ||||
|             &[b"Basic QWxhZGRpbjo=".to_vec()]).unwrap(); | ||||
|         assert_eq!(auth.0.username, "Aladdin"); | ||||
|         assert_eq!(auth.0.password, Some("".to_string())); | ||||
|     } | ||||
| @@ -202,4 +208,4 @@ mod tests { | ||||
| } | ||||
|  | ||||
| bench_header!(raw, Authorization<String>, { vec![b"foo bar baz".to_vec()] }); | ||||
| bench_header!(basic, Authorization<Basic>, { vec![b"Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==".to_vec()] }); | ||||
| bench_header!(basic, Authorization<Basic>, { vec![b"Basic QWxhZGRpbjpuIHNlc2FtZQ==".to_vec()] }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user