Skip to content

Commit

Permalink
chore: update to Rust edition 2021 (denoland#12578)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Nov 2, 2021
1 parent 7033691 commit 8e31bbb
Show file tree
Hide file tree
Showing 40 changed files with 23 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion bench_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion cli/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions core/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions core/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion core/examples/http_bench_json_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion core/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion core/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ext/broadcast_channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/console/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions ext/crypto/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion ext/fetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion ext/ffi/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ext/http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/timers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/tls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/url/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/webgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion ext/webgpu/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
1 change: 0 additions & 1 deletion ext/webgpu/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion ext/webgpu/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions ext/webgpu/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion ext/webidl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/websocket/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ext/webstorage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion runtime/ops/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion serde_v8/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions serde_v8/benches/de.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down
2 changes: 0 additions & 2 deletions serde_v8/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion serde_v8/src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion serde_v8/tests/magic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down
2 changes: 1 addition & 1 deletion test_ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = "test_ffi"
version = "0.1.0"
authors = ["the deno authors"]
edition = "2018"
edition = "2021"
publish = false

[lib]
Expand Down
2 changes: 1 addition & 1 deletion test_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = "test_util"
version = "0.1.0"
authors = ["the Deno authors"]
edition = "2018"
edition = "2021"
publish = false

[[bin]]
Expand Down

0 comments on commit 8e31bbb

Please sign in to comment.