fix: bug on macos arm

see #158
This commit is contained in:
Aloxaf 2021-04-26 18:00:13 +08:00
parent 67914eced0
commit 49d7bb77c9
No known key found for this signature in database
GPG Key ID: A07920B86500DE6C
3 changed files with 6 additions and 4 deletions

3
Cargo.lock generated
View File

@ -933,8 +933,7 @@ dependencies = [
[[package]]
name = "pathfinder_simd"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b451513912d6b3440e443aa75a73ab22203afedc4a90df8526d008c0f86f7cb3"
source = "git+https://github.com/servo/pathfinder#20adbeed149713ae4354cede3a30ca0f622c9943"
dependencies = [
"rustc_version",
]

View File

@ -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

View File

@ -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)?;
@ -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"