implement topic matching

This commit is contained in:
nora 2022-03-20 20:40:02 +01:00
parent 2abc577aca
commit 92e3ac486b

View file

@ -1,5 +1,3 @@
use std::sync::Arc;
use haesli_core::{ use haesli_core::{
exchange::{Exchange, ExchangeType, TopicSegment}, exchange::{Exchange, ExchangeType, TopicSegment},
queue::Queue, queue::Queue,
@ -7,7 +5,7 @@ use haesli_core::{
fn parse_topic(topic: &str) -> Vec<TopicSegment> { fn parse_topic(topic: &str) -> Vec<TopicSegment> {
topic topic
.split(".") .split('.')
.map(|segment| match segment { .map(|segment| match segment {
"*" => TopicSegment::SingleWildcard, "*" => TopicSegment::SingleWildcard,
"#" => TopicSegment::MultiWildcard, "#" => TopicSegment::MultiWildcard,