summaryrefslogtreecommitdiff
path: root/src/resources.rs
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2018-11-04 22:21:21 -0800
committerRyan Dahl <ry@tinyclouds.org>2018-11-06 06:43:02 -0800
commit13e1eb2b87c146a8594e7e6f24ba738bff116246 (patch)
tree9b7c8f8adc012073d728f2412ffe41c8ffe8a59b /src/resources.rs
parentf477b45a0a398e379ecafd2525c460f2793a43c2 (diff)
Fix many of the clippy::pedantic warnings
Diffstat (limited to 'src/resources.rs')
-rw-r--r--src/resources.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/resources.rs b/src/resources.rs
index 5d472adc7..08de09889 100644
--- a/src/resources.rs
+++ b/src/resources.rs
@@ -24,7 +24,7 @@ use std;
use std::collections::HashMap;
use std::io::{Error, Read, Write};
use std::net::{Shutdown, SocketAddr};
-use std::sync::atomic::AtomicIsize;
+use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Mutex;
use tokio;
@@ -32,7 +32,7 @@ use tokio::io::{AsyncRead, AsyncWrite};
use tokio::net::TcpStream;
use tokio_io;
-pub type ResourceId = i32; // Sometimes referred to RID.
+pub type ResourceId = u32; // Sometimes referred to RID.
// These store Deno's file descriptors. These are not necessarily the operating
// system ones.
@@ -40,7 +40,7 @@ type ResourceTable = HashMap<ResourceId, Repr>;
lazy_static! {
// Starts at 3 because stdio is [0-2].
- static ref NEXT_RID: AtomicIsize = AtomicIsize::new(3);
+ static ref NEXT_RID: AtomicUsize = AtomicUsize::new(3);
static ref RESOURCE_TABLE: Mutex<ResourceTable> = Mutex::new({
let mut m = HashMap::new();
// TODO Load these lazily during lookup?
@@ -62,7 +62,7 @@ enum Repr {
Repl(Repl),
}
-pub fn table_entries() -> Vec<(i32, String)> {
+pub fn table_entries() -> Vec<(u32, String)> {
let table = RESOURCE_TABLE.lock().unwrap();
table