Skip to content

Commit 8f75f35

Browse files
committed
fmt: fix formatting
1 parent f930ae3 commit 8f75f35

File tree

1 file changed

+32
-33
lines changed

1 file changed

+32
-33
lines changed

src/main.rs

+32-33
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,41 @@ fn main() {
1717
fn run() -> Result<(), String> {
1818
let command = {
1919
Command::new(env!("CARGO_BIN_NAME"))
20-
.about(
21-
"\
22-
Compile the given Simfony program and print the resulting Simplicity base64 string.\n\
23-
If a Simfony witness is provided, then use it to satisfy the program (requires \
24-
feature 'serde' to be enabled).\
25-
"
26-
)
27-
.arg(
28-
Arg::new("prog_file")
29-
.required(true)
30-
.value_name("PROGRAM_FILE")
31-
.action(ArgAction::Set)
32-
.help("Simfony program file to build")
33-
)
20+
.about(
21+
"\
22+
Compile the given Simfony program and print the resulting Simplicity base64 string.\n\
23+
If a Simfony witness is provided, then use it to satisfy the program (requires \
24+
feature 'serde' to be enabled).\
25+
",
26+
)
27+
.arg(
28+
Arg::new("prog_file")
29+
.required(true)
30+
.value_name("PROGRAM_FILE")
31+
.action(ArgAction::Set)
32+
.help("Simfony program file to build"),
33+
)
3434
};
3535

3636
#[cfg(feature = "serde")]
3737
let command = {
3838
command.arg(
3939
Arg::new("wit_file")
40-
.value_name("WITNESS_FILE")
41-
.action(ArgAction::Set)
42-
.help("File containing the witness data")
40+
.value_name("WITNESS_FILE")
41+
.action(ArgAction::Set)
42+
.help("File containing the witness data"),
4343
)
4444
};
4545

4646
let matches = {
4747
command
48-
.arg(
49-
Arg::new("debug")
50-
.long("debug")
51-
.action(ArgAction::SetTrue)
52-
.help("Include debug symbols in the output")
53-
)
54-
.get_matches()
48+
.arg(
49+
Arg::new("debug")
50+
.long("debug")
51+
.action(ArgAction::SetTrue)
52+
.help("Include debug symbols in the output"),
53+
)
54+
.get_matches()
5555
};
5656

5757
let prog_file = matches.get_one::<String>("prog_file").unwrap();
@@ -64,14 +64,14 @@ fn run() -> Result<(), String> {
6464
#[cfg(feature = "serde")]
6565
let witness_opt = {
6666
matches
67-
.get_one::<String>("wit_file")
68-
.map(|wit_file| -> Result<simfony::WitnessValues, String> {
69-
let wit_path = std::path::Path::new(wit_file);
70-
let wit_text = std::fs::read_to_string(wit_path).map_err(|e| e.to_string())?;
71-
let witness = serde_json::from_str::<simfony::WitnessValues>(&wit_text).unwrap();
72-
Ok(witness)
73-
})
74-
.transpose()?
67+
.get_one::<String>("wit_file")
68+
.map(|wit_file| -> Result<simfony::WitnessValues, String> {
69+
let wit_path = std::path::Path::new(wit_file);
70+
let wit_text = std::fs::read_to_string(wit_path).map_err(|e| e.to_string())?;
71+
let witness = serde_json::from_str::<simfony::WitnessValues>(&wit_text).unwrap();
72+
Ok(witness)
73+
})
74+
.transpose()?
7575
};
7676
#[cfg(not(feature = "serde"))]
7777
let witness_opt: Option<simfony::WitnessValues> = None;
@@ -97,4 +97,3 @@ fn run() -> Result<(), String> {
9797

9898
Ok(())
9999
}
100-

0 commit comments

Comments
 (0)