1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

fix warnings

This commit is contained in:
mat 2023-05-12 18:53:08 +00:00
parent e1e1063d15
commit 80172e4364
3 changed files with 8 additions and 3 deletions

View file

@ -12,7 +12,7 @@ impl ArgumentType for bool {
}
}
pub fn get_bool<'a, S>(context: &'a CommandContext<S>, name: &str) -> Option<bool> {
pub fn get_bool<S>(context: &CommandContext<S>, name: &str) -> Option<bool> {
context
.argument(name)
.unwrap()

View file

@ -44,7 +44,7 @@ pub fn string() -> impl ArgumentType {
pub fn greedy_string() -> impl ArgumentType {
StringArgument::GreedyPhrase
}
pub fn get_string<'a, S>(context: &'a CommandContext<S>, name: &str) -> Option<String> {
pub fn get_string<S>(context: &CommandContext<S>, name: &str) -> Option<String> {
context
.argument(name)
.unwrap()

View file

@ -94,7 +94,7 @@ pub struct Edge<N: Eq + Hash + Copy, W: PartialOrd + Copy> {
pub cost: W,
}
#[derive(PartialOrd, PartialEq)]
#[derive(PartialEq)]
pub struct Weight<W: PartialOrd + Debug>(W);
impl<W: PartialOrd + Debug> Ord for Weight<W> {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
@ -104,3 +104,8 @@ impl<W: PartialOrd + Debug> Ord for Weight<W> {
}
}
impl<W: PartialOrd + Debug> Eq for Weight<W> {}
impl<W: PartialOrd + Debug> PartialOrd for Weight<W> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
self.0.partial_cmp(&other.0)
}
}