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

cloudflare::framework::async_api::Client doesn't implement Debug #214

Open
nitn3lav opened this issue Feb 28, 2023 · 1 comment
Open

cloudflare::framework::async_api::Client doesn't implement Debug #214

nitn3lav opened this issue Feb 28, 2023 · 1 comment

Comments

@nitn3lav
Copy link

the trait Debug is not implemented for cloudflare::framework::async_api::Client

It is quite annoying that I can't add #[derive(Debug)] to any structs/enums containing a Client, which could be easily fixed by adding #[derive(Debug)] before Client.

@yatzbim
Copy link

yatzbim commented Mar 5, 2023

This change is a bit more involved than meets the eye--one of the fields inside of the Cloudflare async client is of type reqwest::Client, which is defined inside a third party crate and contains a whole lot of other structs which also need #[derive(Debug)] annotations.

I'm thinking that we could make our own implementation of Debug for cloudflare::framework::async_api::Client. That would definitely unblock you, and from there we could either decide to leave that as the implementation or try to plumb Debug annotations through the reqwest crate and then annotate with #[derive(Debug)].

FWIW I have a feeling that option 2 will be more trouble than it's worth, given the need for PRs to a third party crate, and moreover give massive outputs containing reqwest::Client internal metadata in debug prints of the Cloudflare client.

Turns out I was wrong here--Client is perfectly capable of having a Debug annotation. I'll post a PR shortly.

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

No branches or pull requests

2 participants