Skip to content

Commit

Permalink
fix: bug on macos arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Aloxaf committed Apr 26, 2021
1 parent 67914ec commit 49d7bb7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ default-features = false
features = ["termcolor", "atty", "humantime"]
optional = true

[patch.crates-io]
pathfinder_simd = { version = "0.5.0", git = "https://github.com/servo/pathfinder" }

[features]
# fearures required for silicon as a application
# disable it when using as a library
Expand Down
4 changes: 2 additions & 2 deletions src/bin/silicon/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pub fn dump_image_to_clipboard(image: &DynamicImage) -> Result<(), Error> {
Ok(())
}

#[cfg(target_os = "macos")]
#[cfg(all(target_os = "macos", not(target_arch = "aarch64")))]
pub fn dump_image_to_clipboard(image: &DynamicImage) -> Result<(), Error> {
let mut temp = tempfile::NamedTempFile::new()?;
image.write_to(&mut temp, ImageOutputFormat::Png)?;
Expand Down Expand Up @@ -67,7 +67,7 @@ pub fn dump_image_to_clipboard(image: &DynamicImage) -> Result<(), Error> {
Ok(())
}

#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))]
#[cfg(not(any(target_os = "linux", all(target_os = "macos", not(target_arch = "aarch64")), target_os = "windows")))]
pub fn dump_image_to_clipboard(_image: &DynamicImage) -> Result<(), Error> {
Err(format_err!(
"This feature hasn't been implemented for your system"
Expand Down

0 comments on commit 49d7bb7

Please sign in to comment.