summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-11-02 15:03:37 +0100
committerGitHub <noreply@github.com>2021-11-02 10:03:37 -0400
commit8e31bbbe551e95a40a78fd96671916f917218b93 (patch)
treef11c7b387b1d9c10898d6a67f37afcafea750d40
parent70336912b4307ac218426a3f5ce938bd8fb7dbb5 (diff)
chore: update to Rust edition 2021 (#12578)
-rw-r--r--.rustfmt.toml2
-rw-r--r--bench_util/Cargo.toml2
-rw-r--r--cli/Cargo.toml2
-rw-r--r--cli/standalone.rs1
-rw-r--r--core/Cargo.toml2
-rw-r--r--core/bindings.rs2
-rw-r--r--core/error.rs2
-rw-r--r--core/examples/http_bench_json_ops.rs1
-rw-r--r--core/modules.rs1
-rw-r--r--core/runtime.rs1
-rw-r--r--ext/broadcast_channel/Cargo.toml2
-rw-r--r--ext/console/Cargo.toml2
-rw-r--r--ext/crypto/Cargo.toml2
-rw-r--r--ext/crypto/lib.rs2
-rw-r--r--ext/fetch/Cargo.toml2
-rw-r--r--ext/ffi/Cargo.toml2
-rw-r--r--ext/ffi/lib.rs1
-rw-r--r--ext/http/Cargo.toml2
-rw-r--r--ext/net/Cargo.toml2
-rw-r--r--ext/timers/Cargo.toml2
-rw-r--r--ext/tls/Cargo.toml2
-rw-r--r--ext/url/Cargo.toml2
-rw-r--r--ext/web/Cargo.toml2
-rw-r--r--ext/webgpu/Cargo.toml2
-rw-r--r--ext/webgpu/binding.rs1
-rw-r--r--ext/webgpu/bundle.rs1
-rw-r--r--ext/webgpu/pipeline.rs1
-rw-r--r--ext/webgpu/texture.rs2
-rw-r--r--ext/webidl/Cargo.toml2
-rw-r--r--ext/websocket/Cargo.toml2
-rw-r--r--ext/webstorage/Cargo.toml2
-rw-r--r--runtime/Cargo.toml2
-rw-r--r--runtime/ops/process.rs1
-rw-r--r--serde_v8/Cargo.toml2
-rw-r--r--serde_v8/benches/de.rs2
-rw-r--r--serde_v8/src/de.rs2
-rw-r--r--serde_v8/src/ser.rs1
-rw-r--r--serde_v8/tests/magic.rs1
-rw-r--r--test_ffi/Cargo.toml2
-rw-r--r--test_util/Cargo.toml2
40 files changed, 23 insertions, 46 deletions
diff --git a/.rustfmt.toml b/.rustfmt.toml
index 00157aef2..7d282f4f0 100644
--- a/.rustfmt.toml
+++ b/.rustfmt.toml
@@ -1,4 +1,4 @@
# Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
max_width = 80
tab_spaces = 2
-edition = "2018"
+edition = "2021"
diff --git a/bench_util/Cargo.toml b/bench_util/Cargo.toml
index ba246cb75..b8a28b50b 100644
--- a/bench_util/Cargo.toml
+++ b/bench_util/Cargo.toml
@@ -3,7 +3,7 @@
name = "deno_bench_util"
version = "0.17.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
publish = true
readme = "README.md"
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 99840d8b0..2e180a494 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -5,7 +5,7 @@ name = "deno"
version = "1.15.3"
authors = ["the Deno authors"]
default-run = "deno"
-edition = "2018"
+edition = "2021"
license = "MIT"
repository = "https://github.com/denoland/deno"
description = "Provides the deno executable"
diff --git a/cli/standalone.rs b/cli/standalone.rs
index 819ba10a4..e0190920f 100644
--- a/cli/standalone.rs
+++ b/cli/standalone.rs
@@ -29,7 +29,6 @@ use deno_runtime::worker::WorkerOptions;
use deno_runtime::BootstrapOptions;
use deno_tls::create_default_root_cert_store;
use log::Level;
-use std::convert::TryInto;
use std::env::current_exe;
use std::fs::File;
use std::io::BufReader;
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 089826ec6..0d3102988 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -3,7 +3,7 @@
name = "deno_core"
version = "0.105.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/core/bindings.rs b/core/bindings.rs
index 2ba8059a0..d1b01c2d9 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -17,8 +17,6 @@ use serde::Deserialize;
use serde::Serialize;
use serde_v8::to_v8;
use std::cell::RefCell;
-use std::convert::TryFrom;
-use std::convert::TryInto;
use std::option::Option;
use url::Url;
use v8::HandleScope;
diff --git a/core/error.rs b/core/error.rs
index b94b7f192..793a42603 100644
--- a/core/error.rs
+++ b/core/error.rs
@@ -4,8 +4,6 @@ pub use anyhow::anyhow;
pub use anyhow::bail;
pub use anyhow::Context;
use std::borrow::Cow;
-use std::convert::TryFrom;
-use std::convert::TryInto;
use std::error::Error;
use std::fmt;
use std::fmt::Debug;
diff --git a/core/examples/http_bench_json_ops.rs b/core/examples/http_bench_json_ops.rs
index 5989a472f..749f40485 100644
--- a/core/examples/http_bench_json_ops.rs
+++ b/core/examples/http_bench_json_ops.rs
@@ -10,7 +10,6 @@ use deno_core::Resource;
use deno_core::ResourceId;
use deno_core::ZeroCopyBuf;
use std::cell::RefCell;
-use std::convert::TryFrom;
use std::env;
use std::io::Error;
use std::net::SocketAddr;
diff --git a/core/modules.rs b/core/modules.rs
index ba7db507e..dc2e5bb32 100644
--- a/core/modules.rs
+++ b/core/modules.rs
@@ -16,7 +16,6 @@ use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
-use std::convert::TryFrom;
use std::future::Future;
use std::pin::Pin;
use std::rc::Rc;
diff --git a/core/runtime.rs b/core/runtime.rs
index 327662e7c..80221295d 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -29,7 +29,6 @@ use futures::task::AtomicWaker;
use std::any::Any;
use std::cell::RefCell;
use std::collections::HashMap;
-use std::convert::TryFrom;
use std::ffi::c_void;
use std::mem::forget;
use std::option::Option;
diff --git a/ext/broadcast_channel/Cargo.toml b/ext/broadcast_channel/Cargo.toml
index 6e6aa7421..d200eb26b 100644
--- a/ext/broadcast_channel/Cargo.toml
+++ b/ext/broadcast_channel/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_broadcast_channel"
version = "0.17.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/console/Cargo.toml b/ext/console/Cargo.toml
index 83c47d73b..f6da8e511 100644
--- a/ext/console/Cargo.toml
+++ b/ext/console/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_console"
version = "0.23.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/crypto/Cargo.toml b/ext/crypto/Cargo.toml
index 9d2f6923b..b66911b1b 100644
--- a/ext/crypto/Cargo.toml
+++ b/ext/crypto/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_crypto"
version = "0.37.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/crypto/lib.rs b/ext/crypto/lib.rs
index d5f95677a..2170e3c72 100644
--- a/ext/crypto/lib.rs
+++ b/ext/crypto/lib.rs
@@ -14,8 +14,6 @@ use serde::Deserialize;
use serde::Serialize;
use std::cell::RefCell;
-use std::convert::TryFrom;
-use std::convert::TryInto;
use std::num::NonZeroU32;
use std::rc::Rc;
diff --git a/ext/fetch/Cargo.toml b/ext/fetch/Cargo.toml
index 36a7a8782..dacdc3297 100644
--- a/ext/fetch/Cargo.toml
+++ b/ext/fetch/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_fetch"
version = "0.46.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/ffi/Cargo.toml b/ext/ffi/Cargo.toml
index 7b8d8f27f..98520ea2e 100644
--- a/ext/ffi/Cargo.toml
+++ b/ext/ffi/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_ffi"
version = "0.10.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs
index f1e593296..a21601e3b 100644
--- a/ext/ffi/lib.rs
+++ b/ext/ffi/lib.rs
@@ -18,7 +18,6 @@ use serde::Deserialize;
use std::borrow::Cow;
use std::cell::RefCell;
use std::collections::HashMap;
-use std::convert::TryFrom;
use std::ffi::c_void;
use std::path::Path;
use std::path::PathBuf;
diff --git a/ext/http/Cargo.toml b/ext/http/Cargo.toml
index c5fc9fdae..d56c3dd54 100644
--- a/ext/http/Cargo.toml
+++ b/ext/http/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_http"
version = "0.15.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/net/Cargo.toml b/ext/net/Cargo.toml
index 5f22be0a8..435ceab9c 100644
--- a/ext/net/Cargo.toml
+++ b/ext/net/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_net"
version = "0.15.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/timers/Cargo.toml b/ext/timers/Cargo.toml
index 0916f2956..08d5980da 100644
--- a/ext/timers/Cargo.toml
+++ b/ext/timers/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_timers"
version = "0.21.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/tls/Cargo.toml b/ext/tls/Cargo.toml
index 869bf1271..c18a2f6fd 100644
--- a/ext/tls/Cargo.toml
+++ b/ext/tls/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_tls"
version = "0.10.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/url/Cargo.toml b/ext/url/Cargo.toml
index 2b4751054..a107f0042 100644
--- a/ext/url/Cargo.toml
+++ b/ext/url/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_url"
version = "0.23.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/web/Cargo.toml b/ext/web/Cargo.toml
index c4e8ae8a7..e7e022047 100644
--- a/ext/web/Cargo.toml
+++ b/ext/web/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_web"
version = "0.54.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/webgpu/Cargo.toml b/ext/webgpu/Cargo.toml
index e7a71de62..150f1d6a4 100644
--- a/ext/webgpu/Cargo.toml
+++ b/ext/webgpu/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_webgpu"
version = "0.24.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/webgpu/binding.rs b/ext/webgpu/binding.rs
index c2dbcf455..4f68c65e9 100644
--- a/ext/webgpu/binding.rs
+++ b/ext/webgpu/binding.rs
@@ -5,7 +5,6 @@ use deno_core::ResourceId;
use deno_core::{OpState, Resource};
use serde::Deserialize;
use std::borrow::Cow;
-use std::convert::{TryFrom, TryInto};
use crate::texture::{GpuTextureFormat, GpuTextureViewDimension};
diff --git a/ext/webgpu/bundle.rs b/ext/webgpu/bundle.rs
index df91104f5..8b2828a30 100644
--- a/ext/webgpu/bundle.rs
+++ b/ext/webgpu/bundle.rs
@@ -7,7 +7,6 @@ use deno_core::{OpState, Resource};
use serde::Deserialize;
use std::borrow::Cow;
use std::cell::RefCell;
-use std::convert::TryInto;
use std::rc::Rc;
use crate::pipeline::GpuIndexFormat;
diff --git a/ext/webgpu/pipeline.rs b/ext/webgpu/pipeline.rs
index 77edcadfb..3b0f03540 100644
--- a/ext/webgpu/pipeline.rs
+++ b/ext/webgpu/pipeline.rs
@@ -6,7 +6,6 @@ use deno_core::{OpState, Resource};
use serde::Deserialize;
use serde::Serialize;
use std::borrow::Cow;
-use std::convert::{TryFrom, TryInto};
use crate::sampler::GpuCompareFunction;
use crate::texture::GpuTextureFormat;
diff --git a/ext/webgpu/texture.rs b/ext/webgpu/texture.rs
index 47e7a14d2..ac3ceda6a 100644
--- a/ext/webgpu/texture.rs
+++ b/ext/webgpu/texture.rs
@@ -6,8 +6,6 @@ use deno_core::ResourceId;
use deno_core::{OpState, Resource};
use serde::Deserialize;
use std::borrow::Cow;
-use std::convert::TryFrom;
-use std::convert::TryInto;
use super::error::WebGpuResult;
pub(crate) struct WebGpuTexture(pub(crate) wgpu_core::id::TextureId);
diff --git a/ext/webidl/Cargo.toml b/ext/webidl/Cargo.toml
index e5d9113a5..9988236ab 100644
--- a/ext/webidl/Cargo.toml
+++ b/ext/webidl/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_webidl"
version = "0.23.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/websocket/Cargo.toml b/ext/websocket/Cargo.toml
index fdef6d55b..0d41f2de6 100644
--- a/ext/websocket/Cargo.toml
+++ b/ext/websocket/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_websocket"
version = "0.28.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/ext/webstorage/Cargo.toml b/ext/webstorage/Cargo.toml
index e6de6465d..c4516d397 100644
--- a/ext/webstorage/Cargo.toml
+++ b/ext/webstorage/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_webstorage"
version = "0.18.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml
index f1d065b16..60f11d703 100644
--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -4,7 +4,7 @@
name = "deno_runtime"
version = "0.31.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
repository = "https://github.com/denoland/deno"
description = "Provides the deno runtime library"
diff --git a/runtime/ops/process.rs b/runtime/ops/process.rs
index 833b1822c..0324cb599 100644
--- a/runtime/ops/process.rs
+++ b/runtime/ops/process.rs
@@ -261,7 +261,6 @@ pub fn kill(pid: i32, signal: &str) -> Result<(), AnyError> {
let signo = super::signal::signal_str_to_int(signal)?;
use nix::sys::signal::{kill as unix_kill, Signal};
use nix::unistd::Pid;
- use std::convert::TryFrom;
let sig = Signal::try_from(signo)?;
unix_kill(Pid::from_raw(pid), Option::Some(sig)).map_err(AnyError::from)
}
diff --git a/serde_v8/Cargo.toml b/serde_v8/Cargo.toml
index ac5d26575..dbb636e0e 100644
--- a/serde_v8/Cargo.toml
+++ b/serde_v8/Cargo.toml
@@ -3,7 +3,7 @@
name = "serde_v8"
version = "0.16.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/denoland/deno"
diff --git a/serde_v8/benches/de.rs b/serde_v8/benches/de.rs
index d800a39a5..83a46eb4e 100644
--- a/serde_v8/benches/de.rs
+++ b/serde_v8/benches/de.rs
@@ -1,8 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use bencher::{benchmark_group, benchmark_main, Bencher};
-use std::convert::TryFrom;
-
use serde::Deserialize;
use serde_v8::utils::{js_exec, v8_do};
diff --git a/serde_v8/src/de.rs b/serde_v8/src/de.rs
index 14edfec03..f803ab381 100644
--- a/serde_v8/src/de.rs
+++ b/serde_v8/src/de.rs
@@ -2,8 +2,6 @@
use serde::de::{self, Visitor};
use serde::Deserialize;
-use std::convert::TryFrom;
-
use crate::error::{Error, Result};
use crate::keys::{v8_struct_key, KeyCache};
use crate::payload::ValueType;
diff --git a/serde_v8/src/ser.rs b/serde_v8/src/ser.rs
index 386e46019..d3853f1a3 100644
--- a/serde_v8/src/ser.rs
+++ b/serde_v8/src/ser.rs
@@ -3,7 +3,6 @@ use serde::ser;
use serde::ser::Serialize;
use std::cell::RefCell;
-use std::convert::TryInto;
use crate::error::{Error, Result};
use crate::keys::v8_struct_key;
diff --git a/serde_v8/tests/magic.rs b/serde_v8/tests/magic.rs
index 15b318baf..036fc5239 100644
--- a/serde_v8/tests/magic.rs
+++ b/serde_v8/tests/magic.rs
@@ -3,7 +3,6 @@ use serde::{Deserialize, Serialize};
use serde_v8::utils::{js_exec, v8_do};
use serde_v8::Result;
-use std::convert::TryFrom;
#[derive(Deserialize)]
struct MagicOp<'s> {
diff --git a/test_ffi/Cargo.toml b/test_ffi/Cargo.toml
index 737efe21e..8c9be227c 100644
--- a/test_ffi/Cargo.toml
+++ b/test_ffi/Cargo.toml
@@ -4,7 +4,7 @@
name = "test_ffi"
version = "0.1.0"
authors = ["the deno authors"]
-edition = "2018"
+edition = "2021"
publish = false
[lib]
diff --git a/test_util/Cargo.toml b/test_util/Cargo.toml
index e93793392..279cb4d30 100644
--- a/test_util/Cargo.toml
+++ b/test_util/Cargo.toml
@@ -4,7 +4,7 @@
name = "test_util"
version = "0.1.0"
authors = ["the Deno authors"]
-edition = "2018"
+edition = "2021"
publish = false
[[bin]]