History

refactor

Sebastian Thiel committed 5 years ago

Commit 2e867231 parent bd323d91 file · +4 −4Browse files

Unified · Split

git-features/src/interrupt.rs+4−4
@@ -14,13 +14,13 @@ mod _impl { · 13 unmodified lines
1414
1515 /// Initialize a signal handler to listen to SIGINT and SIGTERM and trigger our [`trigger()`][super::trigger()] that way.
1616 ///
17− /// When `Ctrl+C` is pressed, a message will be sent to `message_channel` to inform the user about it being registered, after all
17+ /// When `Ctrl+C` is pressed, a message will be sent to `out` to inform the user about it being registered, after all
1818 /// actually responding to it is implementation dependent and might thus take some time (or not work at all).
1919 ///
2020 /// # Note
2121 ///
2222 /// This implementation is available only with the **interrupt-handler** feature toggle with the **disable-interrupts** feature disabled.
23− pub fn init_handler(mut message_channel: impl io::Write + Send + 'static) {
23+ pub fn init_handler(mut out: impl io::Write + Send + 'static) {
2424 ctrlc::set_handler(move || {
2525 const MESSAGES: &[&str] = &[
2626 "interrupt requested",
@@ -34,7 +34,7 @@ mod _impl { · 7 unmodified lines
3434 }
3535 let msg_idx = CURRENT_MESSAGE.fetch_add(1, Ordering::Relaxed);
3636 super::IS_INTERRUPTED.store(true, Ordering::Relaxed);
37− writeln!(message_channel, "{}", MESSAGES[msg_idx % MESSAGES.len()]).ok();
37+ writeln!(out, "{}", MESSAGES[msg_idx % MESSAGES.len()]).ok();
3838 })
3939 .expect("it is up to the application to ensure only one interrupt handler is installed, and this function is called only once.")
4040 }
@@ -48,7 +48,7 @@ mod _impl { · 7 unmodified lines
4848 use std::io;
4949
5050 /// Does nothing, as the **disable-interrupts** feature is enabled while the **interrupt-handler** feature is not present.
51− pub fn init_handler(_message_channel: impl io::Write + Send + 'static) {}
51+ pub fn init_handler(_out: impl io::Write + Send + 'static) {}
5252 }
5353 pub use _impl::init_handler;
5454

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t