-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework repl and add support for history, cursor control, async execut…
…ion etc (#748) * Rework repl and add support for history, cursor control, async execution and more * clippy
- Loading branch information
1 parent
72013b8
commit f801cc7
Showing
12 changed files
with
401 additions
and
135 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,13 @@ | ||
use std::env; | ||
|
||
pub fn get_platform() -> &'static str { | ||
let platform = env::consts::OS; | ||
match platform { | ||
"macos" => "darwin", | ||
"windows" => "win32", | ||
_ => platform, | ||
} | ||
} | ||
|
||
pub fn get_arch() -> &'static str { | ||
let arch = env::consts::ARCH; | ||
|
||
match arch { | ||
"x86_64" | "x86" => return "x64", | ||
"aarch64" => return "arm64", | ||
_ => (), | ||
} | ||
|
||
arch | ||
} | ||
#[cfg(target_os = "macos")] | ||
pub const PLATFORM: &str = "darwin"; | ||
#[cfg(target_os = "windows")] | ||
pub const PLATFORM: &str = "win32"; | ||
#[cfg(not(any(target_os = "macos", target_os = "windows")))] | ||
pub const PLATFORM: &str = std::env::consts::OS; | ||
|
||
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))] | ||
pub const ARCH: &str = "x64"; | ||
#[cfg(target_arch = "aarch64")] | ||
pub const ARCH: &str = "arm64"; | ||
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64")))] | ||
pub const ARCH: &str = std::env::consts::ARCH; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.