-
Notifications
You must be signed in to change notification settings - Fork 83
Start with influxdb-rust crate #1
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
Conversation
.into_iter() | ||
.map(|(field, value)| format!("{field}={value}", field = field, value = value)) | ||
.collect::<Vec<String>>() | ||
.join(","); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, remove the collect
|
||
impl InfluxDbClient { | ||
pub fn ping(&self) -> impl Future<Item = (String, String), Error = ()> { | ||
Client::new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you creating a new Client
everytime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you solve this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, generally I prefer to have the Client
be stored in a variable of the associated type and give the user a way to specify their own Client
if they prefer. This might also be helpful when trying to mock http calls
} | ||
|
||
// fixme: double space | ||
// fixme: quoting / escaping of long strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add fixme in tests. If the code doesn't do what you want, the test should fail. That's the whole idea about testing.
No description provided.