Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: remove unused struct
  • Loading branch information
maxday committed Aug 12, 2024
commit df181d59c9d7acbb641cc6b4845fbafecf8cca0a
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,
});
}
}