Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tiero committed Oct 24, 2023
1 parent c34391d commit 8b74981
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct TranscribeArgs {
async fn main() {
let opts = Opts::parse();
match opts.subcmd {
SubCommand::Serve { port, model_path} => {
SubCommand::Serve { port, model_path } => {
let model_path = Path::new(&model_path);
start_server(port, &model_path).await;

Check warning on line 78 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/main.rs:78:32 | 78 | start_server(port, &model_path).await; | ^^^^^^^^^^^ help: change this to: `model_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow note: the lint level is defined here --> src/main.rs:1:9 | 1 | #![warn(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^ = note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`

Check warning on line 78 in src/main.rs

View workflow job for this annotation

GitHub Actions / clippy

this expression creates a reference which is immediately dereferenced by the compiler

warning: this expression creates a reference which is immediately dereferenced by the compiler --> src/main.rs:78:32 | 78 | start_server(port, &model_path).await; | ^^^^^^^^^^^ help: change this to: `model_path` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow note: the lint level is defined here --> src/main.rs:1:9 | 1 | #![warn(clippy::all, clippy::pedantic, clippy::nursery)] | ^^^^^^^^^^^ = note: `#[warn(clippy::needless_borrow)]` implied by `#[warn(clippy::all)]`
}
Expand All @@ -84,13 +84,15 @@ async fn main() {
async fn start_server(port: u16, model_path: &Path) {
// load model
let whisper = Arc::new(Mutex::new(
Whisper::from_model_path(model_path, Some(Language::Auto)).await
Whisper::from_model_path(model_path, Some(Language::Auto)).await,
));

let make_svc = make_service_fn(move |_conn| {
let whisper_clone = whisper.clone();
async move {
Ok::<_, Infallible>(service_fn(move |req| handle_transcription(req, whisper_clone.clone())))
Ok::<_, Infallible>(service_fn(move |req| {
handle_transcription(req, whisper_clone.clone())
}))
}
});

Expand Down

0 comments on commit 8b74981

Please sign in to comment.