Skip to content

Commit

Permalink
Revert to using io::crate::print, which has been improved
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoStra committed Sep 10, 2022
1 parent 2bbf5e0 commit 62cbfe0
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/modules/julia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,9 @@ use yansi::Paint;
use crate::args::AppConfig;
use crate::data::JULIA_PACKAGES_LIST;
use crate::generators::gen_hex_string;
use crate::io::{csleep, cursor_up, dprint, erase_line, newline};
use crate::io::{csleep, cursor_up, dprint, erase_line, newline, print};
use crate::modules::Module;

// Redefine a more efficient `crate::io::print` function that doesn't type one character at a time.
async fn print<S: Into<String>>(s: S) {
#[cfg(target_arch = "wasm32")]
{
write_to_xterm(s.into().as_str());
}

#[cfg(not(target_arch = "wasm32"))]
{
use std::io::stdout;
use std::io::Write;
print!("{}", s.into());
stdout().flush().unwrap();
}
}

#[derive(Debug)]
pub struct Package<'a> {
pub name: &'a str,
Expand Down

0 comments on commit 62cbfe0

Please sign in to comment.