mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
clippy
This commit is contained in:
parent
9ee5e71bb1
commit
c652bbc609
9 changed files with 14 additions and 22 deletions
|
@ -257,8 +257,7 @@ async fn interactive_get_ms_auth_token(
|
|||
log::trace!("Polling to check if user has logged in...");
|
||||
if let Ok(access_token_response) = client
|
||||
.post(format!(
|
||||
"https://login.live.com/oauth20_token.srf?client_id={}",
|
||||
CLIENT_ID
|
||||
"https://login.live.com/oauth20_token.srf?client_id={CLIENT_ID}"
|
||||
))
|
||||
.form(&vec![
|
||||
("client_id", CLIENT_ID),
|
||||
|
|
|
@ -83,17 +83,12 @@ impl fmt::Debug for BuiltInExceptions {
|
|||
write!(f, "Unclosed quoted string")
|
||||
}
|
||||
BuiltInExceptions::ReaderInvalidEscape { character } => {
|
||||
write!(
|
||||
f,
|
||||
"Invalid escape sequence '{}' in quoted string",
|
||||
character
|
||||
)
|
||||
write!(f, "Invalid escape sequence '{character}' in quoted string")
|
||||
}
|
||||
BuiltInExceptions::ReaderInvalidBool { value } => {
|
||||
write!(
|
||||
f,
|
||||
"Invalid bool, expected true or false but found '{}'",
|
||||
value
|
||||
"Invalid bool, expected true or false but found '{value}'",
|
||||
)
|
||||
}
|
||||
BuiltInExceptions::ReaderInvalidInt { value } => {
|
||||
|
|
|
@ -69,7 +69,7 @@ pub fn create_impl_mcbufreadable(ident: &Ident, data: &Data) -> proc_macro2::Tok
|
|||
variant_discrim = match &d.1 {
|
||||
syn::Expr::Lit(e) => match &e.lit {
|
||||
syn::Lit::Int(i) => i.base10_parse().unwrap(),
|
||||
_ => panic!("Error parsing enum discriminant as int (is {:?})", e),
|
||||
_ => panic!("Error parsing enum discriminant as int (is {e:?})",),
|
||||
},
|
||||
syn::Expr::Unary(_) => {
|
||||
panic!("Negative enum discriminants are not supported")
|
||||
|
|
|
@ -71,7 +71,7 @@ pub fn create_impl_mcbufwritable(ident: &Ident, data: &Data) -> proc_macro2::Tok
|
|||
syn::Expr::Lit(e) => match &e.lit {
|
||||
syn::Lit::Int(i) => i.base10_parse().unwrap(),
|
||||
// syn::Lit::Str(s) => s.value(),
|
||||
_ => panic!("Error parsing enum discriminant as int (is {:?})", e),
|
||||
_ => panic!("Error parsing enum discriminant as int (is {e:?})"),
|
||||
},
|
||||
syn::Expr::Unary(_) => {
|
||||
panic!("Negative enum discriminants are not supported")
|
||||
|
|
|
@ -74,7 +74,8 @@ impl ChatPacket {
|
|||
}
|
||||
|
||||
/// Get the UUID of the sender of the message. If it's not a
|
||||
/// player-sent chat message, this will be None.
|
||||
/// player-sent chat message, this will be None (this is sometimes the case
|
||||
/// when a server uses a plugin to modify chat messages).
|
||||
pub fn uuid(&self) -> Option<Uuid> {
|
||||
match self {
|
||||
ChatPacket::System(_) => None,
|
||||
|
|
|
@ -25,9 +25,7 @@ impl BitSet {
|
|||
fn check_range(&self, from_index: usize, to_index: usize) {
|
||||
assert!(
|
||||
from_index <= to_index,
|
||||
"fromIndex: {} > toIndex: {}",
|
||||
from_index,
|
||||
to_index
|
||||
"fromIndex: {from_index} > toIndex: {to_index}",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,8 +91,7 @@ impl fmt::Display for BitStorageError {
|
|||
match self {
|
||||
BitStorageError::InvalidLength { got, expected } => write!(
|
||||
f,
|
||||
"Invalid length given for storage, got: {}, but expected: {}",
|
||||
got, expected
|
||||
"Invalid length given for storage, got: {got}, but expected: {expected}",
|
||||
),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ impl Trait for azalea_client::Client {
|
|||
for possible_move in possible_moves.iter() {
|
||||
edges.push(Edge {
|
||||
target: possible_move.next_node(node),
|
||||
cost: possible_move.cost(&world, node),
|
||||
cost: possible_move.cost(world, node),
|
||||
});
|
||||
}
|
||||
edges
|
||||
|
|
|
@ -43,7 +43,7 @@ async fn main() -> anyhow::Result<()> {
|
|||
let mut states = Vec::new();
|
||||
|
||||
for i in 0..1 {
|
||||
accounts.push(Account::offline(&format!("bot{}", i)));
|
||||
accounts.push(Account::offline(&format!("bot{i}")));
|
||||
states.push(State::default());
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
|
|||
} else if m.content() == "look" {
|
||||
let target_pos_vec3 = entity.pos();
|
||||
let target_pos: BlockPos = target_pos_vec3.into();
|
||||
println!("target_pos: {:?}", target_pos);
|
||||
println!("target_pos: {target_pos:?}");
|
||||
bot.look_at(&target_pos.center());
|
||||
} else if m.content() == "jump" {
|
||||
bot.set_jumping(true);
|
||||
|
@ -138,10 +138,10 @@ async fn swarm_handle(
|
|||
println!("swarm chat message: {}", m.message().to_ansi());
|
||||
if m.message().to_string() == "<py5> world" {
|
||||
for (name, world) in &swarm.worlds.read().worlds {
|
||||
println!("world name: {}", name);
|
||||
println!("world name: {name}");
|
||||
if let Some(w) = world.upgrade() {
|
||||
for chunk_pos in w.chunk_storage.read().chunks.values() {
|
||||
println!("chunk: {:?}", chunk_pos);
|
||||
println!("chunk: {chunk_pos:?}");
|
||||
}
|
||||
} else {
|
||||
println!("nvm world is gone");
|
||||
|
|
Loading…
Add table
Reference in a new issue