Skip to content

Commit b6768f9

Browse files
committed
am i fixingggggggg again :3
1 parent 273cc4d commit b6768f9

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

cot-core/src/openapi/method.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ mod tests {
520520
use cot::test::TestRequestBuilder;
521521

522522
use super::*;
523+
use crate::Method;
523524
use crate::error::MethodNotAllowed;
524525
use crate::request::extractors::Path;
525526
use crate::response::{IntoResponse, Response};

cot/src/error_page.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ impl ErrorPageTemplateBuilder {
7373
if let Some(not_found) = error.inner().downcast_ref::<NotFound>() {
7474
use cot_core::error::NotFoundKind as Kind;
7575
match &not_found.kind {
76-
Kind::FromRouter => {}
77-
Kind::Custom => {
76+
Kind::FromRouter { .. } => {}
77+
Kind::Custom { .. } => {
7878
Self::build_error_data(&mut error_data, error);
7979
}
80-
Kind::WithMessage(message) => {
80+
Kind::WithMessage { 0: message, .. } => {
8181
Self::build_error_data(&mut error_data, error);
8282
error_message = Some(message.clone());
8383
}
84+
_ => {}
8485
}
8586
}
8687

@@ -164,7 +165,7 @@ impl ErrorPageTemplateBuilder {
164165
}
165166
}
166167

167-
fn build_error_data(vec: &mut Vec<ErrorData>, error: &(dyn std::error::Error + 'static)) {
168+
fn build_error_data(vec: &mut Vec<ErrorData>, error: &(dyn std::error::Error + 'static)) {
168169
let data = ErrorData {
169170
description: error.to_string(),
170171
debug_str: format!("{error:#?}"),

cot/src/request/extractors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use crate::request::RequestExt;
1717
#[derive(Debug, thiserror::Error)]
1818
#[error("invalid content type; expected `{expected}`, found `{actual}`")]
1919
pub struct InvalidContentType {
20-
expected: &'static str,
21-
actual: String,
20+
pub(crate) expected: &'static str,
21+
pub(crate) actual: String,
2222
}
2323
impl_into_cot_error!(InvalidContentType, BAD_REQUEST);
2424

0 commit comments

Comments
 (0)