Closed NickLarsenNZ closed 2 years ago
I could update it to look like the piece a few lines down, like:
if let Some(feed) = self.current_feed.clone() {
feed.link.clone().unwrap_or_else(|| feed.feed_link.unwrap())
} else {
"".to_string()
}
But I think it might be best to instead change the signature to
fn get_current_link(&self) -> Option<String> {
// ...
Then update the pieces of code that call it, do do nothing if it is a None
variant.
Or perhaps add a variant to Selected
to represent when nothing is selected, which is the case on a fresh install.
https://github.com/ckampfe/russ/blob/ed7757ea9e081ad3233485407c1b6c59691defd9/src/modes.rs#L2-L6
Hey @NickLarsenNZ I'm just commenting to say thank for your opening these issues and the PR! It'll likely be a few days before I can review them, but thanks for your contribution!
Thanks for the detailed writeup and suggested fixes @NickLarsenNZ. I was able to reproduce. Fixed in https://github.com/ckampfe/russ/commit/81d16b04b335ef26b27e4b2e6f012085e325ab5c
https://github.com/ckampfe/russ/blob/abb911c57b9ba9deaaa288e5b10ce16ea43e2bd2/src/app.rs#L546-L547