Skip to content

Commit

Permalink
chore: Update to Rust 1.50.0 (#9479)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitsonk authored Feb 12, 2021
1 parent 146fb36 commit 54e53cc
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Install rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.49.0
rust-version: 1.50.0

- name: Install clippy and rustfmt
if: matrix.kind == 'lint'
Expand Down
4 changes: 2 additions & 2 deletions cli/bench/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ fn run_throughput(deno_exe: &PathBuf) -> Result<HashMap<String, f64>> {
let mut m = HashMap::<String, f64>::new();

m.insert("100M_tcp".to_string(), throughput::tcp(deno_exe, 100)?);
m.insert("100M_cat".to_string(), throughput::cat(deno_exe, 100)?);
m.insert("100M_cat".to_string(), throughput::cat(deno_exe, 100));
m.insert("10M_tcp".to_string(), throughput::tcp(deno_exe, 10)?);
m.insert("10M_cat".to_string(), throughput::cat(deno_exe, 10)?);
m.insert("10M_cat".to_string(), throughput::cat(deno_exe, 10));

Ok(m)
}
Expand Down
4 changes: 2 additions & 2 deletions cli/bench/throughput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MB: usize = 1024 * 1024;
const SERVER_ADDR: &str = "0.0.0.0:4544";
const CLIENT_ADDR: &str = "127.0.0.1 4544";

pub(crate) fn cat(deno_exe: &PathBuf, megs: usize) -> Result<f64> {
pub(crate) fn cat(deno_exe: &PathBuf, megs: usize) -> f64 {
let size = megs * MB;
let shell_cmd = format!(
"{} run --allow-read cli/tests/cat.ts /dev/zero | head -c {}",
Expand All @@ -25,7 +25,7 @@ pub(crate) fn cat(deno_exe: &PathBuf, megs: usize) -> Result<f64> {
let _ = test_util::run_collect(cmd, None, None, None, true);
let end = Instant::now();

Ok((end - start).as_secs_f64())
(end - start).as_secs_f64()
}

pub(crate) fn tcp(deno_exe: &PathBuf, megs: usize) -> Result<f64> {
Expand Down
6 changes: 3 additions & 3 deletions cli/lsp/language_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1685,7 +1685,7 @@ impl Inner {
Some(Err(err)) => Err(LspError::invalid_params(err.to_string())),
None => Err(LspError::invalid_params("Missing parameters")),
},
"deno/performance" => self.get_performance(),
"deno/performance" => Ok(Some(self.get_performance())),
"deno/virtualTextDocument" => match params.map(serde_json::from_value) {
Some(Ok(params)) => Ok(Some(
serde_json::to_value(self.virtual_text_document(params).await?)
Expand Down Expand Up @@ -1902,9 +1902,9 @@ impl Inner {
Ok(true)
}

fn get_performance(&self) -> LspResult<Option<Value>> {
fn get_performance(&self) -> Value {
let averages = self.performance.averages();
Ok(Some(json!({ "averages": averages })))
json!({ "averages": averages })
}

async fn virtual_text_document(
Expand Down
1 change: 1 addition & 0 deletions cli/lsp/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,7 @@ fn respond(state: &mut State, args: Value) -> Result<Value, AnyError> {
Ok(json!(true))
}

#[allow(clippy::unnecessary_wraps)]
fn script_names(state: &mut State, _args: Value) -> Result<Value, AnyError> {
Ok(json!(state.state_snapshot.documents.open_specifiers()))
}
Expand Down
1 change: 1 addition & 0 deletions runtime/ops/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn op_main_module(
Ok(json!(&main))
}

#[allow(clippy::unnecessary_wraps)]
fn op_metrics(
state: &mut OpState,
_args: Value,
Expand Down
1 change: 1 addition & 0 deletions runtime/ops/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ pub fn init(rt: &mut deno_core::JsRuntime) {
super::reg_json_sync(rt, "op_sleep_sync", op_sleep_sync);
}

#[allow(clippy::unnecessary_wraps)]
fn op_global_timer_stop(
state: &mut OpState,
_args: Value,
Expand Down

0 comments on commit 54e53cc

Please sign in to comment.