mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
Clean up some old stuff
This commit is contained in:
parent
a72a47ced7
commit
82ed6baea5
3 changed files with 0 additions and 91 deletions
50
Cargo.lock
generated
50
Cargo.lock
generated
|
@ -70,11 +70,6 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "azalea-brigadier"
|
name = "azalea-brigadier"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
|
||||||
"dyn-clonable",
|
|
||||||
"enum_dispatch",
|
|
||||||
"lazy_static",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "azalea-chat"
|
name = "azalea-chat"
|
||||||
|
@ -338,33 +333,6 @@ version = "2.3.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57"
|
checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dyn-clonable"
|
|
||||||
version = "0.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4"
|
|
||||||
dependencies = [
|
|
||||||
"dyn-clonable-impl",
|
|
||||||
"dyn-clone",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dyn-clonable-impl"
|
|
||||||
version = "0.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "dyn-clone"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ee2626afccd7561a06cf1367e2950c4718ea04565e20fb5029b6c7d8ad09abcf"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "either"
|
name = "either"
|
||||||
version = "1.6.1"
|
version = "1.6.1"
|
||||||
|
@ -383,18 +351,6 @@ dependencies = [
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "enum_dispatch"
|
|
||||||
version = "0.3.7"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bd53b3fde38a39a06b2e66dc282f3e86191e53bd04cc499929c15742beae3df8"
|
|
||||||
dependencies = [
|
|
||||||
"once_cell",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.22"
|
version = "1.0.22"
|
||||||
|
@ -730,12 +686,6 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "once_cell"
|
|
||||||
version = "1.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oorandom"
|
name = "oorandom"
|
||||||
version = "11.1.3"
|
version = "11.1.3"
|
||||||
|
|
|
@ -6,6 +6,3 @@ version = "0.1.0"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lazy_static = "^1.4"
|
|
||||||
dyn-clonable = "^0.9"
|
|
||||||
enum_dispatch = "^0.3"
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
use std::rc::Rc;
|
|
||||||
|
|
||||||
use rust_command_parser::{
|
|
||||||
builder::{literal_argument_builder::literal, required_argument_builder::argument},
|
|
||||||
dispatcher::CommandDispatcher,
|
|
||||||
parsers::integer,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CommandSourceStack {
|
|
||||||
player: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let mut dispatcher = CommandDispatcher::<Rc<CommandSourceStack>>::new();
|
|
||||||
|
|
||||||
let source = Rc::new(CommandSourceStack {
|
|
||||||
player: "player".to_string(),
|
|
||||||
});
|
|
||||||
|
|
||||||
dispatcher.register(
|
|
||||||
literal("foo")
|
|
||||||
.then(argument("bar", integer()).executes(|c| {
|
|
||||||
// println!("Bar is {}", get_integer(c, "bar"));
|
|
||||||
2
|
|
||||||
}))
|
|
||||||
.executes(|c| {
|
|
||||||
println!("Called foo with no arguments");
|
|
||||||
1
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
let parse = dispatcher.parse("foo 123".to_string().into(), source);
|
|
||||||
println!("{:?}", parse);
|
|
||||||
println!(
|
|
||||||
"{}",
|
|
||||||
CommandDispatcher::<Rc<CommandSourceStack>>::execute(parse).unwrap()
|
|
||||||
);
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue