Mercurial > crates > nonstick
comparison src/libpam/conversation.rs @ 96:f3e260f9ddcb
Make conversation trait use immutable references.
Since sending a conversation a message doesn't really "mutate" it,
it shouldn't really be considered "mutable" for that purpose.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Mon, 23 Jun 2025 14:26:34 -0400 |
| parents | efc2b56c8928 |
| children | efe2f5f8b5b2 |
comparison
equal
deleted
inserted
replaced
| 95:51c9d7e8261a | 96:f3e260f9ddcb |
|---|---|
| 61 ErrorCode::result_to_c(internal()) | 61 ErrorCode::result_to_c(internal()) |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 impl Conversation for LibPamConversation<'_> { | 65 impl Conversation for LibPamConversation<'_> { |
| 66 fn communicate(&mut self, messages: &[Message]) { | 66 fn communicate(&self, messages: &[Message]) { |
| 67 let internal = || { | 67 let internal = || { |
| 68 let questions = Questions::new(messages)?; | 68 let questions = Questions::new(messages)?; |
| 69 let mut response_pointer = std::ptr::null_mut(); | 69 let mut response_pointer = std::ptr::null_mut(); |
| 70 // SAFETY: We're calling into PAM with valid everything. | 70 // SAFETY: We're calling into PAM with valid everything. |
| 71 let result = unsafe { | 71 let result = unsafe { |
