Skip to content

Commit

Permalink
fix: remove unused struct (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxday authored Aug 12, 2024
1 parent 150c5f0 commit 2cfef41
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions lambda-runtime/src/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,6 @@ impl<'a> IntoRequest for EventErrorRequest<'a> {
}
}

// /runtime/init/error
struct InitErrorRequest;

impl IntoRequest for InitErrorRequest {
fn into_req(self) -> Result<Request<Body>, Error> {
let uri = "/2018-06-01/runtime/init/error".to_string();
let uri = Uri::from_str(&uri)?;

let req = build_request()
.method(Method::POST)
.uri(uri)
.header("lambda-runtime-function-error-type", "unhandled")
.body(Body::empty())?;
Ok(req)
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down Expand Up @@ -237,17 +220,4 @@ mod tests {
None => false,
});
}

#[test]
fn test_init_error_request() {
let req = InitErrorRequest;
let req = req.into_req().unwrap();
let expected = Uri::from_static("/2018-06-01/runtime/init/error");
assert_eq!(req.method(), Method::POST);
assert_eq!(req.uri(), &expected);
assert!(match req.headers().get("User-Agent") {
Some(header) => header.to_str().unwrap().starts_with("aws-lambda-rust/"),
None => false,
});
}
}

0 comments on commit 2cfef41

Please sign in to comment.