Skip to content

Commit

Permalink
clippy & fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jhelovuo committed Jan 7, 2025
1 parent 37feac8 commit 130db8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/discovery/discovery_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ impl DiscoveryDB {

// // TODO: return iterator somehow?
#[cfg(test)] // used only for testing
pub fn get_local_topic_readers<'a, T: TopicDescription>(
&'a self,
topic: &'a T,
pub fn get_local_topic_readers<T: TopicDescription>(
&self,
topic: &T,
) -> Vec<&DiscoveredReaderData> {
let topic_name = topic.name();
self
Expand Down
20 changes: 11 additions & 9 deletions src/structure/dds_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,17 @@ impl TopicCache {
end_instant: Timestamp,
) -> Box<dyn Iterator<Item = (Timestamp, &CacheChange)> + '_> {
// Sanity check
let start_instant =
if start_instant <= end_instant {
// sane case
start_instant
} else {
// insane case
error!("get_changes_in_range_best_effort: Did my clock jump backwards? start={start_instant:?} end={end_instant:?}");
end_instant
};
let start_instant = if start_instant <= end_instant {
// sane case
start_instant
} else {
// insane case
error!(
"get_changes_in_range_best_effort: Did my clock jump backwards? start={start_instant:?} \
end={end_instant:?}"
);
end_instant
};

// Get result as tree range
Box::new(
Expand Down

0 comments on commit 130db8f

Please sign in to comment.