Skip to content

Commit

Permalink
tether-utils insights does not need owned copy of Topics, just ref
Browse files Browse the repository at this point in the history
  • Loading branch information
anselanza committed Dec 23, 2024
1 parent 982ff85 commit b66e92b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion utilities/tether-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tether-utils"
description = "Utilities for Tether Systems"
version = "0.11.1"
version = "0.11.2"
edition = "2021"
license = "MIT"
repository = "https://github.com/RandomStudio/tether"
Expand Down
2 changes: 1 addition & 1 deletion utilities/tether-utils/examples/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn demo_topics() {

loop {
while let Some((topic, payload)) = tether_agent.check_messages() {
if insights.update(topic, payload) {
if insights.update(&topic, payload) {
println!("TOPICS: Insights update: \n{}", insights);
}
}
Expand Down
2 changes: 1 addition & 1 deletion utilities/tether-utils/src/bin/tether/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ fn main() {
std::thread::sleep(Duration::from_millis(1));
}
while let Some((topic, payload)) = tether_agent.check_messages() {
let topics_did_udate = insights.update(topic, payload);
let topics_did_udate = insights.update(&topic, payload);
print_insights_summary(&insights, topics_did_udate, options.graph_enable);
}
if let Ok(elapsed) = last_update.elapsed() {
Expand Down
2 changes: 1 addition & 1 deletion utilities/tether-utils/src/tether_topics/insights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl Insights {
&self.sampler
}

pub fn update(&mut self, topic: TetherOrCustomTopic, payload: Vec<u8>) -> bool {
pub fn update(&mut self, topic: &TetherOrCustomTopic, payload: Vec<u8>) -> bool {
self.message_count += 1;

if self.log_start.is_none() {
Expand Down

0 comments on commit b66e92b

Please sign in to comment.