From 5ace7a49c5b4acf2772d033b1dc137b14e64b8bb Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Thu, 30 Jul 2020 14:27:11 +0800 Subject: [PATCH] Format json prelude This re-formats the json prelude from a single line to a multi-line block delimited by \n\n. --- src/bin/std_env_args.rs | 8 +++++++- src/bin/std_env_vars.rs | 8 +++++++- src/bin/std_fs_create_dir.rs | 6 +++++- src/bin/std_fs_file_create.rs | 6 +++++- src/bin/std_fs_file_metadata.rs | 6 +++++- src/bin/std_fs_file_seek.rs | 6 +++++- src/bin/std_fs_file_set_len.rs | 6 +++++- src/bin/std_fs_file_sync_all.rs | 6 +++++- src/bin/std_fs_file_sync_data.rs | 6 +++++- src/bin/std_fs_hard_link.rs | 7 ++++++- src/bin/std_fs_metadata.rs | 6 +++++- src/bin/std_fs_read.rs | 6 +++++- src/bin/std_fs_read_dir.rs | 6 +++++- src/bin/std_fs_rename.rs | 6 +++++- src/bin/std_fs_symlink_metadata.rs | 6 +++++- src/bin/std_fs_write.rs | 9 ++++++++- src/bin/std_io_stderr.rs | 4 +++- src/bin/std_io_stdin.rs | 4 +++- src/bin/std_io_stdout.rs | 4 +++- src/bin/std_process_exit.rs | 4 +++- 20 files changed, 100 insertions(+), 20 deletions(-) diff --git a/src/bin/std_env_args.rs b/src/bin/std_env_args.rs index ba716f1..8445b74 100644 --- a/src/bin/std_env_args.rs +++ b/src/bin/std_env_args.rs @@ -1,4 +1,10 @@ -// { "args": ["one", "two", "three" ]} +// { +// "args": [ +// "one", +// "two", +// "three" +// ] +// } fn main() { let mut args = std::env::args(); diff --git a/src/bin/std_env_vars.rs b/src/bin/std_env_vars.rs index 5c088a5..8f8fae6 100644 --- a/src/bin/std_env_vars.rs +++ b/src/bin/std_env_vars.rs @@ -1,4 +1,10 @@ -// { "env": { "one": "1", "two": "2", "three": "3" } } +// { +// "env": { +// "one": "1", +// "two": "2", +// "three": "3" +// } +// } fn main() { let vars = std::env::vars(); diff --git a/src/bin/std_fs_create_dir.rs b/src/bin/std_fs_create_dir.rs index 3ea41fd..8e5886c 100644 --- a/src/bin/std_fs_create_dir.rs +++ b/src/bin/std_fs_create_dir.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/scratch": "scratch" } } +// { +// "preopens": { +// "/scratch": "scratch" +// } +// } fn main() { assert!(std::fs::create_dir("/scratch/directory").is_ok()); diff --git a/src/bin/std_fs_file_create.rs b/src/bin/std_fs_file_create.rs index eec1f83..2d8e6f0 100644 --- a/src/bin/std_fs_file_create.rs +++ b/src/bin/std_fs_file_create.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/scratch": "scratch" } } +// { +// "preopens": { +// "/scratch": "scratch" +// } +// } fn main() { assert!(std::fs::File::create("/scratch/file").is_ok()); diff --git a/src/bin/std_fs_file_metadata.rs b/src/bin/std_fs_file_metadata.rs index 93149fd..e43c21a 100644 --- a/src/bin/std_fs_file_metadata.rs +++ b/src/bin/std_fs_file_metadata.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/fixture": "fixture" } } +// { +// "preopens": { +// "/fixture": "fixture" +// } +// } fn main() { let file = std::fs::File::open("/fixture/file").unwrap(); diff --git a/src/bin/std_fs_file_seek.rs b/src/bin/std_fs_file_seek.rs index 1e2a9d7..9206719 100644 --- a/src/bin/std_fs_file_seek.rs +++ b/src/bin/std_fs_file_seek.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/fixture": "fixture" } } +// { +// "preopens": { +// "/fixture": "fixture" +// } +// } use std::io::Seek; diff --git a/src/bin/std_fs_file_set_len.rs b/src/bin/std_fs_file_set_len.rs index 27f1054..9f06426 100644 --- a/src/bin/std_fs_file_set_len.rs +++ b/src/bin/std_fs_file_set_len.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/scratch": "scratch" } } +// { +// "preopens": { +// "/scratch": "scratch" +// } +// } fn main() { let file = std::fs::File::create("/scratch/file").unwrap(); diff --git a/src/bin/std_fs_file_sync_all.rs b/src/bin/std_fs_file_sync_all.rs index bb7bb34..72d7cf7 100644 --- a/src/bin/std_fs_file_sync_all.rs +++ b/src/bin/std_fs_file_sync_all.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/scratch": "scratch" } } +// { +// "preopens": { +// "/scratch": "scratch" +// } +// } fn main() { let file = std::fs::File::create("/scratch/file").unwrap(); diff --git a/src/bin/std_fs_file_sync_data.rs b/src/bin/std_fs_file_sync_data.rs index f19f8e9..db34b73 100644 --- a/src/bin/std_fs_file_sync_data.rs +++ b/src/bin/std_fs_file_sync_data.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/scratch": "scratch" } } +// { +// "preopens": { +// "/scratch": "scratch" +// } +// } use std::io::Write; diff --git a/src/bin/std_fs_hard_link.rs b/src/bin/std_fs_hard_link.rs index cd068f3..35640f3 100644 --- a/src/bin/std_fs_hard_link.rs +++ b/src/bin/std_fs_hard_link.rs @@ -1,4 +1,9 @@ -// { "preopens": { "/fixture": "fixture", "/scratch": "scratch" } } +// { +// "preopens": { +// "/fixture": "fixture", +// "/scratch": "scratch" +// } +// } fn main() { assert!( diff --git a/src/bin/std_fs_metadata.rs b/src/bin/std_fs_metadata.rs index d77ea2a..92aaa7a 100644 --- a/src/bin/std_fs_metadata.rs +++ b/src/bin/std_fs_metadata.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/fixture": "fixture" } } +// { +// "preopens": { +// "/fixture": "fixture" +// } +// } fn main() { let metadata = std::fs::metadata("/fixture/directory").unwrap(); diff --git a/src/bin/std_fs_read.rs b/src/bin/std_fs_read.rs index aa19d3b..344737d 100644 --- a/src/bin/std_fs_read.rs +++ b/src/bin/std_fs_read.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/fixture": "fixture" } } +// { +// "preopens": { +// "/fixture": "fixture" +// } +// } fn main() { assert_eq!(std::fs::read("/fixture/file").unwrap(), b"file\n"); diff --git a/src/bin/std_fs_read_dir.rs b/src/bin/std_fs_read_dir.rs index ad8b70c..93cc14e 100644 --- a/src/bin/std_fs_read_dir.rs +++ b/src/bin/std_fs_read_dir.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/fixture": "fixture" } } +// { +// "preopens": { +// "/fixture": "fixture" +// } +// } fn main() { let entries = std::fs::read_dir("/fixture").unwrap(); diff --git a/src/bin/std_fs_rename.rs b/src/bin/std_fs_rename.rs index 53688ee..70238b8 100644 --- a/src/bin/std_fs_rename.rs +++ b/src/bin/std_fs_rename.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/scratch": "scratch" } } +// { +// "preopens": { +// "/scratch": "scratch" +// } +// } fn main() { let old_path = "/scratch/old_file"; diff --git a/src/bin/std_fs_symlink_metadata.rs b/src/bin/std_fs_symlink_metadata.rs index 1b71fd5..f6d7918 100644 --- a/src/bin/std_fs_symlink_metadata.rs +++ b/src/bin/std_fs_symlink_metadata.rs @@ -1,4 +1,8 @@ -// { "preopens": { "/fixture": "fixture" } } +// { +// "preopens": { +// "/fixture": "fixture" +// } +// } fn main() { let metadata = std::fs::symlink_metadata("/fixture/directory").unwrap(); diff --git a/src/bin/std_fs_write.rs b/src/bin/std_fs_write.rs index 91f8ca1..2b52871 100644 --- a/src/bin/std_fs_write.rs +++ b/src/bin/std_fs_write.rs @@ -1,4 +1,11 @@ -// { "preopens": { "/scratch": "scratch" }, "files": { "scratch/file": "file" } } +// { +// "preopens": { +// "/scratch": "scratch" +// }, +// "files": { +// "scratch/file": "file" +// } +// } fn main() { assert!(std::fs::write("/scratch/file", b"file").is_ok()) diff --git a/src/bin/std_io_stderr.rs b/src/bin/std_io_stderr.rs index 8e1dee3..e71dd2c 100644 --- a/src/bin/std_io_stderr.rs +++ b/src/bin/std_io_stderr.rs @@ -1,4 +1,6 @@ -// { "stderr": "Hello, stderr!" } +// { +// "stderr": "Hello, stderr!" +// } use std::io::Write; diff --git a/src/bin/std_io_stdin.rs b/src/bin/std_io_stdin.rs index 170d575..524cf5e 100644 --- a/src/bin/std_io_stdin.rs +++ b/src/bin/std_io_stdin.rs @@ -1,4 +1,6 @@ -// { "stdin": "Hello, stdin!" } +// { +// "stdin": "Hello, stdin!" +// } use std::io::Read; diff --git a/src/bin/std_io_stdout.rs b/src/bin/std_io_stdout.rs index 3c9058a..ecf951b 100644 --- a/src/bin/std_io_stdout.rs +++ b/src/bin/std_io_stdout.rs @@ -1,4 +1,6 @@ -// { "stdout": "Hello, stdout!" } +// { +// "stdout": "Hello, stdout!" +// } use std::io::Write; diff --git a/src/bin/std_process_exit.rs b/src/bin/std_process_exit.rs index f0fafa8..3675d92 100644 --- a/src/bin/std_process_exit.rs +++ b/src/bin/std_process_exit.rs @@ -1,4 +1,6 @@ -// { "exitCode": 120 } +// { +// "exitCode": 120 +// } fn main() { std::process::exit(120);