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
10 changes: 6 additions & 4 deletions crates/sqlx-cloudflare-do/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ impl Connection for DoConnection {
/// [`connect`](ConnectOptions::connect) always fails: a connection comes from
/// a Durable Object's storage, which only the object itself holds. Use
/// [`DoConnection::new`].
///
/// Non-exhaustive, so parsing is the only way to get one -- as sqlx itself
/// does -- and a field can be added without breaking anyone.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DoConnectOptions {
_private: (),
}
#[non_exhaustive]
pub struct DoConnectOptions;

impl FromStr for DoConnectOptions {
type Err = Error;
Expand All @@ -141,7 +143,7 @@ impl ConnectOptions for DoConnectOptions {

fn from_url(url: &Url) -> Result<Self, Error> {
if url.scheme() == "do" {
Ok(Self { _private: () })
Ok(Self)
} else {
Err(Error::Configuration(
format!("expected a `do://` URL, got scheme `{}`", url.scheme()).into(),
Expand Down
Loading