Skip to content

Commit 448c12d

Browse files
committed
Fixing binary to use latest library API.
Signed-off-by: Kevin Swiber <kswiber@gmail.com>
1 parent 194cec5 commit 448c12d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use clap::{App, Arg};
2+
use postman2openapi::{from_path, from_str, TranspileOptions};
23
use std::io::{stdin, Read};
34

45
fn main() {
@@ -29,14 +30,14 @@ fn main() {
2930
let matches = app.get_matches();
3031

3132
let mut buffer = String::new();
32-
let output_format = matches.value_of_t("output").unwrap_or_else(|e| e.exit());
33+
let format = matches.value_of_t("output").unwrap_or_else(|e| e.exit());
3334
match &matches.value_of("INPUT") {
34-
Some(filename) => match postman2openapi::from_path(filename, output_format) {
35+
Some(filename) => match from_path(filename, TranspileOptions { format }) {
3536
Ok(oas) => println!("{}", oas),
3637
Err(err) => eprintln!("{}", err),
3738
},
3839
None => match stdin().read_to_string(&mut buffer) {
39-
Ok(_) => match postman2openapi::from_str(&buffer, output_format) {
40+
Ok(_) => match from_str(&buffer, TranspileOptions { format }) {
4041
Ok(oas) => println!("{}", oas),
4142
Err(err) => eprintln!("{}", err),
4243
},

0 commit comments

Comments
 (0)