Skip to content

Commit

Permalink
Merge pull request #68 from qwandor/lifetimes
Browse files Browse the repository at this point in the history
Lifetime of new Point shouldn't be tied to lifetime of measurement
  • Loading branch information
driftluo authored Jan 17, 2025
2 parents 73409e1 + 4e0054f commit 0e63c06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ pub struct Point<'a> {

impl<'a> Point<'a> {
/// Create a new point
pub fn new(measurement: &str) -> Point {
Point {
pub fn new(measurement: &'_ str) -> Self {
Self {
measurement: String::from(measurement),
tags: HashMap::new(),
fields: HashMap::new(),
Expand Down
2 changes: 2 additions & 0 deletions tests/client_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ fn create_and_delete_measurement() {

tokio::spawn(client.write_point(point, Some(Precision::Seconds), None))
.await
.unwrap()
.unwrap();

client.drop_measurement("temporary").await.unwrap();
Expand Down Expand Up @@ -62,6 +63,7 @@ fn use_points() {

tokio::spawn(client.write_points(points, Some(Precision::Seconds), None))
.await
.unwrap()
.unwrap();

sleep(Duration::from_secs(3));
Expand Down

0 comments on commit 0e63c06

Please sign in to comment.