diff options
| author | Eskil Queseth <eskilq@kth.se> | 2020-10-17 21:17:46 +0200 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2020-10-17 21:17:46 +0200 |
| commit | 7675171e2c307c91a81b0daee915c2a114ae4612 (patch) | |
| tree | 34d3109424ae6f3798687da3710abf332d5814d5 /mumlib/src/state.rs | |
| parent | d66eea26a29ede1c8eb981d372011fb2e35dce14 (diff) | |
| parent | 39b13833187e4331fa32c1601f1bf1b1d6fa036a (diff) | |
| download | mum-7675171e2c307c91a81b0daee915c2a114ae4612.tar.gz | |
Merge remote-tracking branch 'origin/channel-name' into main
Diffstat (limited to 'mumlib/src/state.rs')
| -rw-r--r-- | mumlib/src/state.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mumlib/src/state.rs b/mumlib/src/state.rs index f90634e..51fb492 100644 --- a/mumlib/src/state.rs +++ b/mumlib/src/state.rs @@ -128,6 +128,13 @@ impl Channel { pub fn name(&self) -> &str { &self.name } + + pub fn path(&self, channels: &HashMap<u32, Channel>) -> String { + match &self.parent { + Some(t) => format!("{}/{}", channels.get(t).unwrap().path(channels), self.name), + None => self.name.clone(), + } + } } #[derive(Clone, Debug, Deserialize, Serialize)] |
