Skip to content

Commit f2cd1ba

Browse files
unlimitedsolabluetech
authored andcommitted
pcsc,pcsc-sys: make ctl_code const fn
1 parent 836ffab commit f2cd1ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pcsc-sys/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ pub const SCARD_ATTR_DEVICE_FRIENDLY_NAME: DWORD = SCARD_ATTR_DEVICE_FRIENDLY_NA
302302
pub const SCARD_ATTR_DEVICE_SYSTEM_NAME: DWORD = SCARD_ATTR_DEVICE_SYSTEM_NAME_A;
303303

304304
#[cfg(target_os = "windows")]
305-
pub fn SCARD_CTL_CODE(code: DWORD) -> DWORD {
305+
pub const fn SCARD_CTL_CODE(code: DWORD) -> DWORD {
306306
0x0031_0000 | (code << 2)
307307
}
308308
#[cfg(not(target_os = "windows"))]
309-
pub fn SCARD_CTL_CODE(code: DWORD) -> DWORD {
309+
pub const fn SCARD_CTL_CODE(code: DWORD) -> DWORD {
310310
0x4200_0000 + code
311311
}
312312

pcsc/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ pub fn PNP_NOTIFICATION() -> &'static CStr {
583583
/// to this function.
584584
///
585585
/// This function wraps the `SCARD_CTL_CODE` macro.
586-
pub fn ctl_code(code: DWORD) -> DWORD {
586+
pub const fn ctl_code(code: DWORD) -> DWORD {
587587
ffi::SCARD_CTL_CODE(code)
588588
}
589589

0 commit comments

Comments
 (0)