Fix windows build

This commit is contained in:
John Doty 2022-12-17 10:04:22 -08:00
parent 1a5228c380
commit ff5d767d87
2 changed files with 9 additions and 5 deletions

View file

@ -20,7 +20,6 @@ tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1" tokio-stream = "0.1"
toml = "0.5" toml = "0.5"
tui = "0.19" tui = "0.19"
users = "0.11"
xdg = "2" xdg = "2"
[dev-dependencies] [dev-dependencies]
@ -29,3 +28,6 @@ tempdir = "0.3"
[target.'cfg(target_os="linux")'.dependencies] [target.'cfg(target_os="linux")'.dependencies]
procfs = "0.14.1" procfs = "0.14.1"
[target.'cfg(target_family="unix")'.dependencies]
users = "0.11"

View file

@ -1,5 +1,5 @@
use crate::message::Message; use crate::message::Message;
use anyhow::Result; use anyhow::{anyhow, Result};
use tokio::sync::mpsc; use tokio::sync::mpsc;
#[cfg(target_family = "unix")] #[cfg(target_family = "unix")]
@ -17,8 +17,10 @@ pub async fn browse_url(url: &String) {
} }
#[cfg(not(target_family = "unix"))] #[cfg(not(target_family = "unix"))]
pub async fn browse_url_impl(url: &String) -> Result<()> { pub async fn browse_url_impl(_url: &String) -> Result<()> {
anyhow!("Opening a browser is not supported on this platform") Err(anyhow!(
"Opening a browser is not supported on this platform"
))
} }
#[inline] #[inline]
@ -30,7 +32,7 @@ pub async fn handle_browser_open(
#[cfg(not(target_family = "unix"))] #[cfg(not(target_family = "unix"))]
async fn handle_browser_open_impl( async fn handle_browser_open_impl(
messages: mpsc::Sender<Message>, _messages: mpsc::Sender<Message>,
) -> Result<()> { ) -> Result<()> {
std::future::pending().await std::future::pending().await
} }