@@ -81,36 +81,35 @@ impl HueshiftConfig {
8181
8282 /// Default current temp for any screens
8383 fn default_current_temp ( ) -> u16 {
84- 6500 as u16
84+ 6500
8585 }
8686 /// Max/Min hue temperature (min 1000K, max 10_000K)
8787 // TODO: Try to detect if we're using redshift or not
8888 // to set default max_temp either to 10_000K to 25_000K
8989 fn default_min_temp ( ) -> u16 {
90- 1000 as u16
90+ 1000
9191 }
9292 fn default_max_temp ( ) -> u16 {
93- 10_000 as u16
93+ 10_000
9494 }
9595
9696 fn default_step ( ) -> u16 {
97- 100 as u16
97+ 100
9898 }
9999
100100 /// Prefer any installed shifter, redshift is preferred though.
101101 fn default_hue_shifter ( ) -> Option < HueShifter > {
102- let ( redshift, sct) = what_is_supported ( ) ;
103- if redshift {
104- return Some ( HueShifter :: Redshift ) ;
105- } else if sct {
106- return Some ( HueShifter :: Sct ) ;
102+ if has_command ( "hueshift" , "redshift" ) . unwrap_or ( false ) {
103+ Some ( HueShifter :: Redshift )
104+ } else if has_command ( "hueshift" , "sct" ) . unwrap_or ( false ) {
105+ Some ( HueShifter :: Sct )
106+ } else {
107+ None
107108 }
108-
109- None
110109 }
111110
112111 fn default_click_temp ( ) -> u16 {
113- 6500 as u16
112+ 6500
114113 }
115114
116115 fn default_color_overrides ( ) -> Option < BTreeMap < String , String > > {
@@ -216,22 +215,6 @@ impl Block for Hueshift {
216215 }
217216}
218217
219- /// Currently, detects whether sct and redshift are installed.
220- #[ inline]
221- fn what_is_supported ( ) -> ( bool , bool ) {
222- let has_redshift = match has_command ( "hueshift" , "redshift" ) {
223- Ok ( has_redshift) => has_redshift,
224- Err ( _) => false ,
225- } ;
226-
227- let has_sct = match has_command ( "hueshift" , "sct" ) {
228- Ok ( has_sct) => has_sct,
229- Err ( _) => false ,
230- } ;
231-
232- ( has_redshift, has_sct)
233- }
234-
235218#[ inline]
236219fn update_hue ( hue_shifter : & Option < HueShifter > , new_temp : u16 ) {
237220 match hue_shifter {
0 commit comments