Skip to content

Commit 71f20c4

Browse files
committed
Unmark list_accounts as unsafe
1 parent c7126f0 commit 71f20c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/devolutions-pedm/src/account.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ impl PartialEq<Account> for AccountWithId {
209209
///
210210
/// `LookupAccountNameW` must be called to enable `ConvertSidToStringSidW` to work.
211211
#[cfg(target_os = "windows")]
212-
pub(crate) unsafe fn list_accounts() -> Result<Vec<Account>, ListAccountsError> {
212+
pub(crate) fn list_accounts() -> Result<Vec<Account>, ListAccountsError> {
213213
use windows::core::PWSTR;
214214
use windows::Win32::NetworkManagement::NetManagement::{
215215
NERR_Success, NetApiBufferFree, NetUserEnum, FILTER_NORMAL_ACCOUNT, MAX_PREFERRED_LENGTH, USER_INFO_0,

crates/devolutions-pedm/src/api/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub async fn serve(config: Config, shutdown_signal: ShutdownSignal) -> Result<()
183183
// Update the list of accounts in the database.
184184

185185
// SAFETY: uses `NetUserEnum` and `LookupAccountNameW` from `windows`
186-
let accounts = unsafe { list_accounts()? };
186+
let accounts = list_accounts()?;
187187

188188
let db_accounts = db.get_accounts().await?;
189189
info!("Accounts retrieved successfully");

0 commit comments

Comments
 (0)