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

derive Debug for Pool #42

Merged
merged 1 commit into from Jan 10, 2020
Merged

derive Debug for Pool #42

merged 1 commit into from Jan 10, 2020

Conversation

onsails
Copy link
Contributor

@onsails onsails commented Jan 10, 2020

In some frameworks Debug is required to put Pool in app state's context structs which define Debug by default.

@abonander
Copy link
Collaborator

abonander commented Jan 10, 2020

We'd love to accept this change, but we'd like to manually impl Debug for Pool to only show information that's meaningful to the user instead of deriving for Pool and SharedPool. For one, we don't need to require Debug for the DB type parameter which the derive would.

The manual impl should print the following values as if they were fields of Pool using Formatter::debug_struct():

  • SharedPool::url as url (needs a getter that Pool can access)
  • SharedPool::size() as size
  • SharedPool::num_idle() as num_idle
  • SharedPool::closed as closed (needs a getter)
  • SharedPool::options() as options (we can leave the derive on struct Options)

@onsails
Copy link
Contributor Author

onsails commented Jan 10, 2020

Thanks for feedback, updated PR.

@abonander
Copy link
Collaborator

Great! Thanks for the quick response. I'll merge this when the build's passing.

@abonander abonander merged commit 5e9887a into launchbadge:master Jan 10, 2020
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.

None yet

2 participants