Skip to content

Commit

Permalink
format & lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Dec 23, 2019
1 parent c9b8644 commit 0563f54
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions cli/http_body.rs
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
use tokio::io::AsyncRead;
use bytes::Bytes;
use futures::Stream;
use futures::StreamExt;
use std::cmp::min;
use bytes::Bytes;
use reqwest;
use std::cmp::min;
use std::io;
use std::io::Read;
use std::pin::Pin;
use std::task::Context;
use std::task::Poll;
use tokio::io::AsyncRead;

// TODO(bartlomieju): most of this stuff can be moved to `cli/ops/fetch.rs`
type ReqwestStream = Pin<Box<dyn Stream<Item = reqwest::Result<Bytes>> + Send>>;

/// Wraps `ReqwestStream` so that it can be exposed as an `AsyncRead` and integrated
/// into resources more easily.
pub struct HttpBody {
stream: ReqwestStream,
stream: ReqwestStream,
chunk: Option<Bytes>,
pos: usize,
}
Expand All @@ -26,8 +26,8 @@ impl HttpBody {
pub fn from(body: ReqwestStream) -> Self {
Self {
stream: body,
chunk: None,
pos: 0,
chunk: None,
pos: 0,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/http_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use reqwest::header::HeaderMap;
use reqwest::header::CONTENT_TYPE;
use reqwest::header::LOCATION;
use reqwest::header::USER_AGENT;
use reqwest::Client;
use reqwest::redirect::Policy;
use reqwest::Client;
use std::future::Future;
use url::Url;

Expand Down
20 changes: 10 additions & 10 deletions cli/js/process_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ import {
test,
testPerm,
assert,
assertEquals,
assertStrContains
assertEquals
// assertStrContains
} from "./test_util.ts";
const {
kill,
run,
DenoError,
ErrorKind,
readFile,
open,
makeTempDir,
writeFile
// kill,
run
// DenoError,
// ErrorKind,
// readFile,
// open,
// makeTempDir,
// writeFile
} = Deno;

test(function runPermissions(): void {
Expand Down
10 changes: 5 additions & 5 deletions cli/js/tls_test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test, testPerm, assert, assertEquals } from "./test_util.ts";
import { BufWriter, BufReader } from "../../std/io/bufio.ts";
import { TextProtoReader } from "../../std/textproto/mod.ts";
import { test, testPerm, assertEquals } from "./test_util.ts";
// import { BufWriter, BufReader } from "../../std/io/bufio.ts";
// import { TextProtoReader } from "../../std/textproto/mod.ts";
import { runIfMain } from "../../std/testing/mod.ts";

const encoder = new TextEncoder();
const decoder = new TextDecoder();
// const encoder = new TextEncoder();
// const decoder = new TextDecoder();

test(async function dialTLSNoPerm(): Promise<void> {
let err;
Expand Down
2 changes: 1 addition & 1 deletion cli/ops/workers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn op_create_worker(
.await;
sender.send(result).expect("Failed to send message");
}
.boxed();
.boxed();
tokio::spawn(fut);

let result = receiver.recv().expect("Failed to receive message");
Expand Down
2 changes: 1 addition & 1 deletion cli/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ mod tests {
println!("workers.rs after resource close");
result.unwrap();
}
.shared();
.shared();

let worker_future_ = worker_future.clone();
tokio::spawn(worker_future_);
Expand Down

0 comments on commit 0563f54

Please sign in to comment.