refactor(headers): errors for parse_header
Header::parse_header() returns now a hyper Result instead of an option this will enable more precise Error messages in the future, currently most failures are reported as ::Error::Header. BREAKING CHANGE: parse_header returns Result instead of Option, related code did also change
This commit is contained in:
		| @@ -45,8 +45,8 @@ header! { | ||||
|             Some(Upgrade(vec![Protocol::new(ProtocolName::WebSocket, None)]))); | ||||
|         #[test] | ||||
|         fn test3() { | ||||
|             let x: Option<Upgrade> = Header::parse_header(&[b"WEbSOCKet".to_vec()]); | ||||
|             assert_eq!(x, Some(Upgrade(vec![Protocol::new(ProtocolName::WebSocket, None)]))); | ||||
|             let x: ::Result<Upgrade> = Header::parse_header(&[b"WEbSOCKet".to_vec()]); | ||||
|             assert_eq!(x.ok(), Some(Upgrade(vec![Protocol::new(ProtocolName::WebSocket, None)]))); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user