diff options
author | Canop <cano.petrole@gmail.com> | 2022-07-06 19:20:25 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-07-06 19:20:25 +0200 |
commit | d4751c863011bf2583b07942363df3f70db37d97 (patch) | |
tree | 56892f629b2780fc5df6bc85b3a8db1194fb3329 /src/display | |
parent | 3454e1efa0c90b8680c130e6b98ee87cb85a4f8c (diff) |
disable luma detection on non linux platformv1.14.1no-luma-on-non-linux
To fix compilation
See #573
Diffstat (limited to 'src/display')
-rw-r--r-- | src/display/luma.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/display/luma.rs b/src/display/luma.rs index c9e9105..479e4c9 100644 --- a/src/display/luma.rs +++ b/src/display/luma.rs @@ -15,6 +15,7 @@ pub enum Luma { /// Return the light of the terminal background, which is a value /// between 0 (black) and 1 (white). +#[cfg(target_os = "linux")] pub fn luma() -> &'static Result<f32, terminal_light::TlError> { static LUMA: Lazy<Result<f32, terminal_light::TlError>> = Lazy::new(|| { let luma = time!(Debug, terminal_light::luma()); @@ -24,6 +25,11 @@ pub fn luma() -> &'static Result<f32, terminal_light::TlError> { &*LUMA } +#[cfg(not(target_os = "linux"))] +pub fn luma() -> Result<&'static f32, &'static str> { + Err("not implemented on this OS") +} + impl Luma { pub fn read() -> Self { match luma() { |