para: para
}
}
+
+ pub fn from_id(id: &str, client: &mut Client) -> Self {
+ let parent_text = match client.status_by_id(id) {
+ Ok(st) => Html::new(&st.content).to_para(),
+ Err(e) => Paragraph::new().add(&ColouredString::plain(
+ &format!("[unavailable: {}]", e)
+ )),
+ };
+ Self::new(parent_text)
+ }
}
impl TextFragment for InReplyToLine {
let irt = match &st.in_reply_to_id {
None => None,
- Some(id) => {
- let parent_text = match client.status_by_id(id) {
- Ok(st) => Html::new(&st.content).to_para(),
- Err(e) => Paragraph::new().add(&ColouredString::plain(
- &format!("[unavailable: {}]", e)
- )),
- };
- Some(InReplyToLine::new(parent_text))
- }
+ Some(id) => Some(InReplyToLine::from_id(id, client)),
};
let content = Html::new(&st.content);