Skip to content
Snippets Groups Projects

take bytes path as argument in `komodo.nu` and `cargo run`

Merged STEVAN Antoine requested to merge take-bytes-path-as-argument into main
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -27,7 +27,7 @@ fn parse_args() -> (Vec<u8>, usize, usize, bool, String, bool, bool, Vec<String>
@@ -27,7 +27,7 @@ fn parse_args() -> (Vec<u8>, usize, usize, bool, String, bool, bool, Vec<String>
let bytes_path = std::env::args()
let bytes_path = std::env::args()
.nth(1)
.nth(1)
.expect("expected path to bytes as first positional argument");
.expect("expected path to bytes as first positional argument");
let bytes = if bytes_path == "" {
let bytes = if bytes_path.is_empty() {
vec![]
vec![]
} else {
} else {
std::fs::read(bytes_path).unwrap()
std::fs::read(bytes_path).unwrap()
Loading