remove extra format

This commit is contained in:
yggverse 2025-02-24 03:05:13 +02:00
parent e1553f6d6f
commit 160ef13ba6
25 changed files with 67 additions and 67 deletions

View file

@ -51,7 +51,7 @@ impl<'a> Response<'a> {
fn test() { fn test() {
// 10 // 10
{ {
let source = format!("10 message\r\n"); let source = "10 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -64,7 +64,7 @@ fn test() {
assert_eq!(target.into_bytes(), source.as_bytes()); assert_eq!(target.into_bytes(), source.as_bytes());
} }
{ {
let source = format!("11 message\r\n"); let source = "11 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -78,7 +78,7 @@ fn test() {
} }
// 20 // 20
{ {
let source = format!("20 text/gemini\r\ndata"); let source = "20 text/gemini\r\ndata";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -94,7 +94,7 @@ fn test() {
} }
// 30 // 30
{ {
let source = format!("30 target\r\n"); let source = "30 target\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -108,7 +108,7 @@ fn test() {
} }
// 31 // 31
{ {
let source = format!("31 target\r\n"); let source = "31 target\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -125,7 +125,7 @@ fn test() {
use failure::Temporary; use failure::Temporary;
// 40 // 40
{ {
let source = format!("40 message\r\n"); let source = "40 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -144,7 +144,7 @@ fn test() {
} }
// 41 // 41
{ {
let source = format!("41 message\r\n"); let source = "41 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -163,7 +163,7 @@ fn test() {
} }
// 42 // 42
{ {
let source = format!("42 message\r\n"); let source = "42 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -182,7 +182,7 @@ fn test() {
} }
// 43 // 43
{ {
let source = format!("43 message\r\n"); let source = "43 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -201,7 +201,7 @@ fn test() {
} }
// 44 // 44
{ {
let source = format!("44 message\r\n"); let source = "44 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -224,7 +224,7 @@ fn test() {
use failure::Permanent; use failure::Permanent;
// 50 // 50
{ {
let source = format!("50 message\r\n"); let source = "50 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -243,7 +243,7 @@ fn test() {
} }
// 51 // 51
{ {
let source = format!("51 message\r\n"); let source = "51 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -262,7 +262,7 @@ fn test() {
} }
// 52 // 52
{ {
let source = format!("52 message\r\n"); let source = "52 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -281,7 +281,7 @@ fn test() {
} }
// 53 // 53
{ {
let source = format!("53 message\r\n"); let source = "53 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -300,7 +300,7 @@ fn test() {
} }
// 59 // 59
{ {
let source = format!("59 message\r\n"); let source = "59 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -320,7 +320,7 @@ fn test() {
} }
// 60 // 60
{ {
let source = format!("60 message\r\n"); let source = "60 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -336,7 +336,7 @@ fn test() {
} }
// 61 // 61
{ {
let source = format!("61 message\r\n"); let source = "61 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -352,7 +352,7 @@ fn test() {
} }
// 62 // 62
{ {
let source = format!("62 message\r\n"); let source = "62 message\r\n";
let target = Response::from_bytes(source.as_bytes()).unwrap(); let target = Response::from_bytes(source.as_bytes()).unwrap();
match target { match target {

View file

@ -42,7 +42,7 @@ impl Certificate {
#[test] #[test]
fn test() { fn test() {
// 60 // 60
let request = format!("60 message\r\n"); let request = "60 message\r\n";
let source = Certificate::from_bytes(request.as_bytes()).unwrap(); let source = Certificate::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -52,7 +52,7 @@ fn test() {
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());
// 61 // 61
let request = format!("61 message\r\n"); let request = "61 message\r\n";
let source = Certificate::from_bytes(request.as_bytes()).unwrap(); let source = Certificate::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -64,7 +64,7 @@ fn test() {
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());
// 62 // 62
let request = format!("62 message\r\n"); let request = "62 message\r\n";
let source = Certificate::from_bytes(request.as_bytes()).unwrap(); let source = Certificate::from_bytes(request.as_bytes()).unwrap();
match source { match source {

View file

@ -52,7 +52,7 @@ impl Expected {
#[test] #[test]
fn test() { fn test() {
let request = format!("60 message\r\n"); let request = "60 message\r\n";
let source = Expected::from_bytes(request.as_bytes()).unwrap(); let source = Expected::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl NotAuthorized {
#[test] #[test]
fn test() { fn test() {
let request = format!("61 message\r\n"); let request = "61 message\r\n";
let source = NotAuthorized::from_bytes(request.as_bytes()).unwrap(); let source = NotAuthorized::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl NotValid {
#[test] #[test]
fn test() { fn test() {
let request = format!("62 message\r\n"); let request = "62 message\r\n";
let source = NotValid::from_bytes(request.as_bytes()).unwrap(); let source = NotValid::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -38,7 +38,7 @@ fn test() {
{ {
// 40 // 40
{ {
let request = format!("40 message\r\n"); let request = "40 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -54,7 +54,7 @@ fn test() {
} }
// 41 // 41
{ {
let request = format!("41 message\r\n"); let request = "41 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -70,7 +70,7 @@ fn test() {
} }
// 42 // 42
{ {
let request = format!("42 message\r\n"); let request = "42 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -86,7 +86,7 @@ fn test() {
} }
// 43 // 43
{ {
let request = format!("43 message\r\n"); let request = "43 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -102,7 +102,7 @@ fn test() {
} }
// 44 // 44
{ {
let request = format!("44 message\r\n"); let request = "44 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -121,7 +121,7 @@ fn test() {
{ {
// 50 // 50
{ {
let request = format!("50 message\r\n"); let request = "50 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -137,7 +137,7 @@ fn test() {
} }
// 51 // 51
{ {
let request = format!("51 message\r\n"); let request = "51 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -153,7 +153,7 @@ fn test() {
} }
// 52 // 52
{ {
let request = format!("52 message\r\n"); let request = "52 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -169,7 +169,7 @@ fn test() {
} }
// 53 // 53
{ {
let request = format!("53 message\r\n"); let request = "53 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -185,7 +185,7 @@ fn test() {
} }
// 59 // 59
{ {
let request = format!("59 message\r\n"); let request = "59 message\r\n";
let source = Failure::from_bytes(request.as_bytes()).unwrap(); let source = Failure::from_bytes(request.as_bytes()).unwrap();
match source { match source {

View file

@ -58,7 +58,7 @@ impl Permanent {
fn test() { fn test() {
// 50 // 50
{ {
let source = format!("50 message\r\n"); let source = "50 message\r\n";
let target = Permanent::from_bytes(source.as_bytes()).unwrap(); let target = Permanent::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -69,7 +69,7 @@ fn test() {
} }
// 51 // 51
{ {
let source = format!("51 message\r\n"); let source = "51 message\r\n";
let target = Permanent::from_bytes(source.as_bytes()).unwrap(); let target = Permanent::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -80,7 +80,7 @@ fn test() {
} }
// 52 // 52
{ {
let source = format!("52 message\r\n"); let source = "52 message\r\n";
let target = Permanent::from_bytes(source.as_bytes()).unwrap(); let target = Permanent::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -91,7 +91,7 @@ fn test() {
} }
// 53 // 53
{ {
let source = format!("53 message\r\n"); let source = "53 message\r\n";
let target = Permanent::from_bytes(source.as_bytes()).unwrap(); let target = Permanent::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -104,7 +104,7 @@ fn test() {
} }
// 59 // 59
{ {
let source = format!("59 message\r\n"); let source = "59 message\r\n";
let target = Permanent::from_bytes(source.as_bytes()).unwrap(); let target = Permanent::from_bytes(source.as_bytes()).unwrap();
match target { match target {

View file

@ -52,7 +52,7 @@ impl BadRequest {
#[test] #[test]
fn test() { fn test() {
let request = format!("59 message\r\n"); let request = "59 message\r\n";
let source = BadRequest::from_bytes(request.as_bytes()).unwrap(); let source = BadRequest::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl General {
#[test] #[test]
fn test() { fn test() {
let request = format!("50 message\r\n"); let request = "50 message\r\n";
let source = General::from_bytes(request.as_bytes()).unwrap(); let source = General::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl Gone {
#[test] #[test]
fn test() { fn test() {
let request = format!("52 message\r\n"); let request = "52 message\r\n";
let source = Gone::from_bytes(request.as_bytes()).unwrap(); let source = Gone::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl NotFound {
#[test] #[test]
fn test() { fn test() {
let request = format!("51 message\r\n"); let request = "51 message\r\n";
let source = NotFound::from_bytes(request.as_bytes()).unwrap(); let source = NotFound::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl ProxyRequestRefused {
#[test] #[test]
fn test() { fn test() {
let request = format!("53 message\r\n"); let request = "53 message\r\n";
let source = ProxyRequestRefused::from_bytes(request.as_bytes()).unwrap(); let source = ProxyRequestRefused::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -57,7 +57,7 @@ impl Temporary {
fn test() { fn test() {
// 40 // 40
{ {
let source = format!("40 message\r\n"); let source = "40 message\r\n";
let target = Temporary::from_bytes(source.as_bytes()).unwrap(); let target = Temporary::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -68,7 +68,7 @@ fn test() {
} }
// 41 // 41
{ {
let source = format!("41 message\r\n"); let source = "41 message\r\n";
let target = Temporary::from_bytes(source.as_bytes()).unwrap(); let target = Temporary::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -81,7 +81,7 @@ fn test() {
} }
// 42 // 42
{ {
let source = format!("42 message\r\n"); let source = "42 message\r\n";
let target = Temporary::from_bytes(source.as_bytes()).unwrap(); let target = Temporary::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -92,7 +92,7 @@ fn test() {
} }
// 43 // 43
{ {
let source = format!("43 message\r\n"); let source = "43 message\r\n";
let target = Temporary::from_bytes(source.as_bytes()).unwrap(); let target = Temporary::from_bytes(source.as_bytes()).unwrap();
match target { match target {
@ -105,7 +105,7 @@ fn test() {
} }
// 44 // 44
{ {
let source = format!("44 message\r\n"); let source = "44 message\r\n";
let target = Temporary::from_bytes(source.as_bytes()).unwrap(); let target = Temporary::from_bytes(source.as_bytes()).unwrap();
match target { match target {

View file

@ -52,7 +52,7 @@ impl CgiError {
#[test] #[test]
fn test() { fn test() {
let request = format!("42 message\r\n"); let request = "42 message\r\n";
let source = CgiError::from_bytes(request.as_bytes()).unwrap(); let source = CgiError::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl General {
#[test] #[test]
fn test() { fn test() {
let request = format!("40 message\r\n"); let request = "40 message\r\n";
let source = General::from_bytes(request.as_bytes()).unwrap(); let source = General::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl ProxyError {
#[test] #[test]
fn test() { fn test() {
let request = format!("43 message\r\n"); let request = "43 message\r\n";
let source = ProxyError::from_bytes(request.as_bytes()).unwrap(); let source = ProxyError::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl ServerUnavailable {
#[test] #[test]
fn test() { fn test() {
let request = format!("41 message\r\n"); let request = "41 message\r\n";
let source = ServerUnavailable::from_bytes(request.as_bytes()).unwrap(); let source = ServerUnavailable::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl SlowDown {
#[test] #[test]
fn test() { fn test() {
let request = format!("44 message\r\n"); let request = "44 message\r\n";
let source = SlowDown::from_bytes(request.as_bytes()).unwrap(); let source = SlowDown::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -37,7 +37,7 @@ impl Input {
#[test] #[test]
fn test() { fn test() {
// 10 // 10
let request = format!("10 message\r\n"); let request = "10 message\r\n";
let source = Input::from_bytes(request.as_bytes()).unwrap(); let source = Input::from_bytes(request.as_bytes()).unwrap();
match source { match source {
@ -47,7 +47,7 @@ fn test() {
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());
// 11 // 11
let request = format!("11 message\r\n"); let request = "11 message\r\n";
let source = Input::from_bytes(request.as_bytes()).unwrap(); let source = Input::from_bytes(request.as_bytes()).unwrap();
match source { match source {

View file

@ -52,7 +52,7 @@ impl Default {
#[test] #[test]
fn test() { fn test() {
let request = format!("10 message\r\n"); let request = "10 message\r\n";
let source = Default::from_bytes(request.as_bytes()).unwrap(); let source = Default::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -52,7 +52,7 @@ impl Sensitive {
#[test] #[test]
fn test() { fn test() {
let request = format!("11 message\r\n"); let request = "11 message\r\n";
let source = Sensitive::from_bytes(request.as_bytes()).unwrap(); let source = Sensitive::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.message, Some("message".to_string())); assert_eq!(source.message, Some("message".to_string()));

View file

@ -37,23 +37,23 @@ impl Redirect {
#[test] #[test]
fn test() { fn test() {
// 30 // 30
let request = format!("30 message\r\n"); let request = "30 message\r\n";
let source = Redirect::from_bytes(request.as_bytes()).unwrap(); let source = Redirect::from_bytes(request.as_bytes()).unwrap();
match source { match source {
Redirect::Temporary(ref this) => { Redirect::Temporary(ref this) => {
assert_eq!(this.target, "message".to_string()) assert_eq!(this.target, "message")
} }
_ => panic!(), _ => panic!(),
} }
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());
// 31 // 31
let request = format!("31 message\r\n"); let request = "31 message\r\n";
let source = Redirect::from_bytes(request.as_bytes()).unwrap(); let source = Redirect::from_bytes(request.as_bytes()).unwrap();
match source { match source {
Redirect::Permanent(ref this) => assert_eq!(this.target, "message".to_string()), Redirect::Permanent(ref this) => assert_eq!(this.target, "message"),
_ => panic!(), _ => panic!(),
} }
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());

View file

@ -40,9 +40,9 @@ impl Permanent {
#[test] #[test]
fn test() { fn test() {
let request = format!("31 target\r\n"); let request = "31 target\r\n";
let source = Permanent::from_bytes(request.as_bytes()).unwrap(); let source = Permanent::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.target, "target".to_string()); assert_eq!(source.target, "target");
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());
} }

View file

@ -40,9 +40,9 @@ impl Temporary {
#[test] #[test]
fn test() { fn test() {
let request = format!("30 target\r\n"); let request = "30 target\r\n";
let source = Temporary::from_bytes(request.as_bytes()).unwrap(); let source = Temporary::from_bytes(request.as_bytes()).unwrap();
assert_eq!(source.target, "target".to_string()); assert_eq!(source.target, "target");
assert_eq!(source.into_bytes(), request.as_bytes()); assert_eq!(source.into_bytes(), request.as_bytes());
} }

View file

@ -30,7 +30,7 @@ impl<'a> Success<'a> {
#[test] #[test]
fn test() { fn test() {
let request = format!("20 text/gemini\r\nDATA"); let request = "20 text/gemini\r\nDATA";
let source = Success::from_bytes(request.as_bytes()).unwrap(); let source = Success::from_bytes(request.as_bytes()).unwrap();
match source { match source {