Skip to content

Commit

Permalink
Change terminal bell to function api
Browse files Browse the repository at this point in the history
  • Loading branch information
Piturnah committed Jul 29, 2024
1 parent 372b9f4 commit b99f510
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,8 @@ pub fn window_size() -> io::Result<WindowSize> {
/// Typically this is a bell sound, but may also be a visual alert such as a screen flash.
///
/// See [Wikipedia](https://en.wikipedia.org/wiki/Bell_character).
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Bell;

impl fmt::Display for Bell {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use fmt::Write;
f.write_char(0x07 as char)
}
pub fn bell() {
print!("{}", 0x07 as char);
}

/// Disables line wrapping.
Expand Down

0 comments on commit b99f510

Please sign in to comment.