Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mac and windows #17

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion more-wallpapers/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#[cfg(target_os = "linux")]
use std::env;
use std::{ffi::OsString, io, process::Command};
use std::io;
#[cfg(target_os = "linux")]
use std::{ffi::OsString, process::Command};
use thiserror::Error;

#[cfg(target_os = "linux")]
Expand Down Expand Up @@ -69,6 +71,7 @@ pub(crate) trait Context<V> {
C: std::fmt::Display;
}

/// add path as additional info to erro and convert it to a [WallpaperError].
impl<V> Context<V> for Result<V, io::Error> {
fn context<C>(self, context: C) -> Result<V, WallpaperError>
where
Expand Down
4 changes: 3 additions & 1 deletion more-wallpapers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ mod error;
use camino::{Utf8Path, Utf8PathBuf};
#[cfg(target_os = "linux")]
use error::load_env_var;
#[cfg(target_os = "linux")]
pub use error::CommandError;
use error::Context;
pub use error::{CommandError, WallpaperError};
pub use error::WallpaperError;
use std::io;
use strum_macros::{Display, EnumString};

Expand Down
Loading