Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

impl Debug for Statement #1153

Merged
merged 1 commit into from
Jul 6, 2024
Merged

impl Debug for Statement #1153

merged 1 commit into from
Jul 6, 2024

Conversation

cammeresi
Copy link
Contributor

The lack of this common trait bound caused some unpleasantness. For example, the following didn't compile:

let x = OnceLock::new();
let stmt = db.prepare(...)?;
x.set(stmt).expect(...); // returns Result<(), T=Statement> where T: Debug

The lack of this common trait bound caused some unpleasantness.
For example, the following didn't compile:

let x = OnceLock::new();
let stmt = db.prepare(...)?;
x.set(stmt).expect(...); // returns Result<(), T=Statement> where T: Debug
@sfackler
Copy link
Owner

sfackler commented Jul 6, 2024

LGTM, but the specific example in the PR description would probably be more cleanly implemented as x.set(stmt).ok().expect(...) since the debug representation of the second statement is probably not going to provide any extra clarity.

@sfackler sfackler merged commit 0bd8b2b into sfackler:master Jul 6, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants