File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,10 @@ impl std::convert::TryFrom<ThreadPriority> for WinAPIThreadPriority {
102102 ThreadPriority :: Crossplatform ( crate :: ThreadPriorityValue ( p) ) => match p {
103103 0 => WinAPIThreadPriority :: Idle ,
104104 1 ..=19 => WinAPIThreadPriority :: Lowest ,
105- 21 ..=39 => WinAPIThreadPriority :: BelowNormal ,
106- 41 ..=59 => WinAPIThreadPriority :: Normal ,
107- 61 ..=79 => WinAPIThreadPriority :: AboveNormal ,
108- 81 ..=98 => WinAPIThreadPriority :: Highest ,
105+ 20 ..=39 => WinAPIThreadPriority :: BelowNormal ,
106+ 40 ..=59 => WinAPIThreadPriority :: Normal ,
107+ 60 ..=79 => WinAPIThreadPriority :: AboveNormal ,
108+ 80 ..=98 => WinAPIThreadPriority :: Highest ,
109109 99 => WinAPIThreadPriority :: TimeCritical ,
110110 _ => return Err ( Error :: Priority ( "The value is out of range [0; 99]." ) ) ,
111111 } ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use thread_priority::*;
66#[ rstest]
77#[ case( ThreadPriority :: Min , ThreadPriority :: Os ( WinAPIThreadPriority :: Lowest . try_into( ) . unwrap( ) ) ) ]
88#[ case( ThreadPriority :: Crossplatform ( 23u8 . try_into( ) . unwrap( ) ) , ThreadPriority :: Os ( WinAPIThreadPriority :: BelowNormal . try_into( ) . unwrap( ) ) ) ]
9+ #[ case( ThreadPriority :: Crossplatform ( 80u8 . try_into( ) . unwrap( ) ) , ThreadPriority :: Os ( WinAPIThreadPriority :: Highest . try_into( ) . unwrap( ) ) ) ]
910#[ case( ThreadPriority :: Max , ThreadPriority :: Os ( WinAPIThreadPriority :: Highest . try_into( ) . unwrap( ) ) ) ]
1011fn get_and_set_priority_requires_capabilities (
1112 #[ case] input_priority : ThreadPriority ,
You can’t perform that action at this time.
0 commit comments