Skip to content
Open
Show file tree
Hide file tree
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
11 changes: 11 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ jobs:
- name: Check style
run: cargo fmt -- --check

check-docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- name: Report cargo version
run: cargo --version
- name: Check docs
run: cargo doc --no-deps
env:
RUSTDOCFLAGS: -D warnings

clippy-lint:
runs-on: ubuntu-24.04
steps:
Expand Down
4 changes: 2 additions & 2 deletions dropshot/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,11 @@ impl HttpError {
/// If this error does not already have a header map (`self.header_map` is
/// `None`), this method creates one.
///
/// Unlike [`HttpError::set_header`], this method takes `self` by value,
/// Unlike [`HttpError::add_header`], this method takes `self` by value,
/// allowing it to be chained to form an expression that returns an
/// `HttpError`. However, because this takes `self` by value, returning an
/// error for an invalid header name or value will discard the `HttpError`.
/// To avoid this, use [`HttpError::set_header`] instead.
/// To avoid this, use [`HttpError::add_header`] instead.
///
/// # Returns
///
Expand Down
4 changes: 2 additions & 2 deletions dropshot/src/error_status_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::fmt;
/// Alternatively, constants are provided for known error status codes, such as
/// [`ErrorStatusCode::BAD_REQUEST`], [`ErrorStatusCode::NOT_FOUND`],
/// [`ErrorStatusCode::INTERNAL_SERVER_ERROR`], and so on, including those in
/// the IANA HTTP Status Code Registry](
/// the [IANA HTTP Status Code Registry](
/// https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
/// Using these constants avoids the fallible conversion from an
/// [`http::StatusCode`].
Expand Down Expand Up @@ -425,7 +425,7 @@ impl_status_code_wrapper! {
///
/// Alternatively, constants are provided for known error status codes, such as
/// [`ClientErrorStatusCode::BAD_REQUEST`],
/// [`ClientErrorStatusCode::NOT_FOUND`], including those in the IANA HTTP
/// [`ClientErrorStatusCode::NOT_FOUND`], including those in the [IANA HTTP
/// Status Code Registry](
/// https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
/// Using these constants avoids the fallible conversion from an
Expand Down
1 change: 1 addition & 0 deletions dropshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ pub use handler::FreeformBody;
pub use handler::HttpCodedResponse;
pub use handler::HttpResponse;
pub use handler::HttpResponseAccepted;
pub use handler::HttpResponseContent;
pub use handler::HttpResponseCreated;
pub use handler::HttpResponseDeleted;
pub use handler::HttpResponseError;
Expand Down
2 changes: 1 addition & 1 deletion dropshot/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl ClientTestContext {
}

/// Temporarily configures the client to expect `E`-typed error responses,
/// rather than [`dropshot::HttpError`] error responses.
/// rather than [`dropshot::HttpError`][`crate::HttpError`] error responses.
///
/// `ClientTestContext` expects that all error responses are
/// `dropshot::HttpError`. For testing APIs that return other error types, this
Expand Down
12 changes: 6 additions & 6 deletions dropshot/tests/fail/bad_endpoint7.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `HttpResponseOk`
--> src/handler.rs
|
| pub struct HttpResponseOk<T: HttpResponseContent + Send + Sync + 'static>(
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `HttpResponseOk`

error[E0277]: the trait bound `Ret: dropshot::handler::HttpResponseContent` is not satisfied
error[E0277]: the trait bound `Ret: HttpResponseContent` is not satisfied
--> tests/fail/bad_endpoint7.rs:25:23
|
25 | Ok(HttpResponseOk(Ret {
Expand All @@ -45,7 +45,7 @@ error[E0277]: the trait bound `Ret: dropshot::handler::HttpResponseContent` is n
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `HttpResponseOk`
--> src/handler.rs
|
Expand All @@ -70,7 +70,7 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `HttpResponseOk`
--> src/handler.rs
|
Expand Down Expand Up @@ -98,7 +98,7 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `HttpResponseOk`
--> src/handler.rs
|
Expand All @@ -125,7 +125,7 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `HttpResponseOk`
--> src/handler.rs
|
Expand Down
16 changes: 8 additions & 8 deletions dropshot/tests/fail/bad_trait_endpoint7.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0277]: the trait bound `Ret: dropshot::handler::HttpResponseContent` is not satisfied
error[E0277]: the trait bound `Ret: HttpResponseContent` is not satisfied
--> tests/fail/bad_trait_endpoint7.rs:41:27
|
41 | Ok(HttpResponseOk(Ret { x: "Oxide".to_string(), y: 0x1de }))
Expand All @@ -16,7 +16,7 @@ error[E0277]: the trait bound `Ret: dropshot::handler::HttpResponseContent` is n
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `dropshot::HttpResponseOk`
--> src/handler.rs
|
Expand All @@ -41,7 +41,7 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `dropshot::HttpResponseOk`
--> src/handler.rs
|
Expand All @@ -66,7 +66,7 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `dropshot::HttpResponseOk`
--> src/handler.rs
|
Expand All @@ -93,14 +93,14 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `dropshot::HttpResponseOk`
--> src/handler.rs
|
| pub struct HttpResponseOk<T: HttpResponseContent + Send + Sync + 'static>(
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `HttpResponseOk`

error[E0277]: the trait bound `Ret: dropshot::handler::HttpResponseContent` is not satisfied
error[E0277]: the trait bound `Ret: HttpResponseContent` is not satisfied
--> tests/fail/bad_trait_endpoint7.rs:28:10
|
28 | ) -> Result<HttpResponseOk<Ret>, HttpError>;
Expand All @@ -116,7 +116,7 @@ error[E0277]: the trait bound `Ret: dropshot::handler::HttpResponseContent` is n
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `dropshot::HttpResponseOk`
--> src/handler.rs
|
Expand All @@ -141,7 +141,7 @@ error[E0277]: the trait bound `Ret: serde::ser::Serialize` is not satisfied
(T0, T1, T2, T3)
(T0, T1, T2, T3, T4)
and $N others
= note: required for `Ret` to implement `dropshot::handler::HttpResponseContent`
= note: required for `Ret` to implement `HttpResponseContent`
note: required by a bound in `dropshot::HttpResponseOk`
--> src/handler.rs
|
Expand Down