pub mod draft;
mod followed;
mod link;
pub mod round;
pub mod watch;
pub use followed::{Due, Followed, Heading, Reply, Work};
pub use link::IssueLink;
use crate::engine::host::Host;
pub fn link_of(host: &Host) -> Option<IssueLink> {
let request = host.read(|state| {
state
.run
.started
.as_ref()
.map(|started| started.request.clone())
})?;
IssueLink::for_request(host.repo().state_dir(), &request)
}
fn remote_of<'r>(remotes: &'r [String], named: Option<&str>) -> Option<&'r String> {
match named {
Some(named) => remotes.iter().find(|remote| *remote == named),
None => remotes
.iter()
.find(|remote| *remote == "origin")
.or(remotes.first()),
}
}