Take advantage of 2018 edition.

- Remove explicit 'extern crate' fields where useful
- Fix mutability of variable (unrelated?)
- Add rbxmx dependency, which needs 2018 edition
This commit is contained in:
Lucien Greathouse
2018-11-27 10:50:52 -08:00
parent 6617b8b6c4
commit f7689f3154
6 changed files with 32 additions and 17 deletions

19
server/Cargo.lock generated
View File

@@ -641,13 +641,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "rbx-tree" name = "rbx-tree"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/LPGhatguy/rbx-tree.git#258b458cffbcbd01e3f1cf5bbd701cc75260f01a" source = "git+https://github.com/LPGhatguy/rbx-tree.git#0fe8dacd013668e194afb1d074161477ebc759b6"
dependencies = [ dependencies = [
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "rbxmx"
version = "0.1.0"
source = "git+https://github.com/LPGhatguy/rbx-tree.git#0fe8dacd013668e194afb1d074161477ebc759b6"
dependencies = [
"rbx-tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)",
"xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.1.40" version = "0.1.40"
@@ -700,6 +709,7 @@ dependencies = [
"notify 4.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rbx-tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)", "rbx-tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)",
"rbxmx 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)",
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rouille 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rouille 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1069,6 +1079,11 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]]
name = "xml-rs"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata] [metadata]
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" "checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
"checksum aho-corasick 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee94e9463ccb9d681e7b708082687b2c56d2bd420ca8a3d3157d27d59508ec0" "checksum aho-corasick 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee94e9463ccb9d681e7b708082687b2c56d2bd420ca8a3d3157d27d59508ec0"
@@ -1149,6 +1164,7 @@ dependencies = [
"checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c" "checksum rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e464cd887e869cddcae8792a4ee31d23c7edd516700695608f5b98c67ee0131c"
"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2"
"checksum rbx-tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)" = "<none>" "checksum rbx-tree 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)" = "<none>"
"checksum rbxmx 0.1.0 (git+https://github.com/LPGhatguy/rbx-tree.git)" = "<none>"
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "67d0301b0c6804eca7e3c275119d0b01ff3b7ab9258a65709e608a66312a1025" "checksum regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "67d0301b0c6804eca7e3c275119d0b01ff3b7ab9258a65709e608a66312a1025"
@@ -1200,3 +1216,4 @@ dependencies = [
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
"checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba" "checksum wincolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "561ed901ae465d6185fa7864d63fbd5720d0ef718366c9a4dc83cf6170d7e9ba"
"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
"checksum xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "541b12c998c5b56aa2b4e6f18f03664eef9a4fd0a246a55594efae6cc2d964b5"

View File

@@ -31,6 +31,7 @@ regex = "1.0"
log = "0.4" log = "0.4"
env_logger = "0.5" env_logger = "0.5"
rbx-tree = { git = "https://github.com/LPGhatguy/rbx-tree.git" } rbx-tree = { git = "https://github.com/LPGhatguy/rbx-tree.git" }
rbxmx = { git = "https://github.com/LPGhatguy/rbx-tree.git" }
uuid = { version = "0.7", features = ["v4", "serde"] } uuid = { version = "0.7", features = ["v4", "serde"] }
[dev-dependencies] [dev-dependencies]

View File

@@ -1,8 +1,5 @@
#[macro_use] extern crate clap; #[macro_use] extern crate clap;
#[macro_use] extern crate log; #[macro_use] extern crate log;
extern crate env_logger;
extern crate librojo;
use std::{ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},

View File

@@ -1,13 +1,8 @@
#[macro_use] extern crate log; #[macro_use]
#[macro_use] extern crate rouille; extern crate log;
#[macro_use] extern crate serde_derive;
extern crate notify; #[macro_use]
extern crate rand; extern crate serde_derive;
extern crate rbx_tree;
extern crate regex;
extern crate serde;
extern crate serde_json;
extern crate uuid;
#[cfg(test)] #[cfg(test)]
extern crate tempfile; extern crate tempfile;

View File

@@ -35,7 +35,7 @@ impl PathIdTree {
pub fn insert(&mut self, path: &Path, id: RbxId) { pub fn insert(&mut self, path: &Path, id: RbxId) {
if let Some(parent_path) = path.parent() { if let Some(parent_path) = path.parent() {
if let Some(mut parent) = self.nodes.get_mut(parent_path) { if let Some(parent) = self.nodes.get_mut(parent_path) {
parent.children.insert(path.to_path_buf()); parent.children.insert(path.to_path_buf());
} }
} }
@@ -48,7 +48,7 @@ impl PathIdTree {
pub fn remove(&mut self, root_path: &Path) -> Option<RbxId> { pub fn remove(&mut self, root_path: &Path) -> Option<RbxId> {
if let Some(parent_path) = root_path.parent() { if let Some(parent_path) = root_path.parent() {
if let Some(mut parent) = self.nodes.get_mut(parent_path) { if let Some(parent) = self.nodes.get_mut(parent_path) {
parent.children.remove(root_path); parent.children.remove(root_path);
} }
} }

View File

@@ -4,7 +4,12 @@ use std::{
sync::{mpsc, Arc}, sync::{mpsc, Arc},
}; };
use rouille::{self, Request, Response}; use rouille::{
self,
router,
Request,
Response,
};
use rbx_tree::{RbxId, RootedRbxInstance}; use rbx_tree::{RbxId, RootedRbxInstance};
use crate::{ use crate::{