Skip to content

Commit

Permalink
Merge pull request #324 from AnthonyTornetta/323-fix-clippy
Browse files Browse the repository at this point in the history
323 fix clippy
  • Loading branch information
AnthonyTornetta authored Sep 2, 2024
2 parents eb5f6e7 + 92e9f2c commit cc559d0
Show file tree
Hide file tree
Showing 12 changed files with 682 additions and 594 deletions.
1,252 changes: 664 additions & 588 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ members = ["cosmos_client", "cosmos_core", "cosmos_server"]
resolver = "2"

[workspace.dependencies]
bevy = { version = "0.14.0", default-features = false }
bevy = { version = "0.14.1", default-features = false }
bevy_rapier3d = { git = "https://github.com/AnthonyTornetta/bevy_rapier", version = "0.27.0", branch = "context-component", features = [
"simd-stable",
"serde-serialize",
Expand Down
1 change: 1 addition & 0 deletions cosmos_client/src/asset/materials/animated_material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pub const ATTRIBUTE_TEXTURE_INDEX: MeshVertexAttribute =
MeshVertexAttribute::new("ArrayTextureIndex", 923840841, VertexFormat::Uint32);

/// An enum to define which UV attribute to use for a texture.
///
/// It is used for every texture in the [`AnimatedArrayTextureMaterial`].
/// It only supports two UV attributes, [`Mesh::ATTRIBUTE_UV_0`] and [`Mesh::ATTRIBUTE_UV_1`].
/// The default is [`UvChannel::Uv0`].
Expand Down
1 change: 1 addition & 0 deletions cosmos_client/src/asset/materials/block_materials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub const ATTRIBUTE_TEXTURE_INDEX: MeshVertexAttribute =
MeshVertexAttribute::new("ArrayTextureIndex", 923840841, VertexFormat::Uint32);

/// An enum to define which UV attribute to use for a texture.
///
/// It is used for every texture in the [`ArrayTextureMaterial`].
/// It only supports two UV attributes, [`Mesh::ATTRIBUTE_UV_0`] and [`Mesh::ATTRIBUTE_UV_1`].
/// The default is [`UvChannel::Uv0`].
Expand Down
1 change: 1 addition & 0 deletions cosmos_client/src/asset/materials/lod_materials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use crate::*;
pub const ATTRIBUTE_PACKED_DATA: MeshVertexAttribute = MeshVertexAttribute::new("PackedData", 923840840, VertexFormat::Uint32);

/// An enum to define which UV attribute to use for a texture.
///
/// It is used for every texture in the [`LodArrayTextureMaterial`].
/// It only supports two UV attributes, [`Mesh::ATTRIBUTE_UV_0`] and [`Mesh::ATTRIBUTE_UV_1`].
/// The default is [`UvChannel::Uv0`].
Expand Down
1 change: 1 addition & 0 deletions cosmos_core/src/block/block_direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use super::block_face::BlockFace;

#[derive(Default, PartialEq, Eq, Debug, Copy, Clone, Reflect, Hash, Serialize, Deserialize)]
/// Enumerates the 6 possible directions: a positive and negative direction for each of the 3 axes of 3-dimensional space.
///
/// Moving in the direction indicated by each of these variants should always change the corresponding coordinate in the indicated direction (relative to the structure).
pub enum BlockDirection {
/// The positive X direction.
Expand Down
1 change: 1 addition & 0 deletions cosmos_core/src/block/specific_blocks/xor_gate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Logic behavior for "Xor Gate", a block with left and right inputs and a front output.
//!
//! Outputs 1 if exactly one input is present and 1. Outputs 0 if (both inputs are present and non-zero) or (both inputs are not present or zero).

use std::{cell::RefCell, rc::Rc};
Expand Down
1 change: 1 addition & 0 deletions cosmos_core/src/logic/logic_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use super::{logic_graph::LogicGraph, LogicBlock, LogicWireColor, Port, PortType,

#[derive(Debug, Default, Reflect, Component)]
/// The public interface for accessing and mutating an [`Entity`]'s [`LogicGraph`].
///
/// Any functionality needed for specific logic blocks (for example, wires and logic gates) should use this struct and never directly access the [`LogicGraph`].
pub struct LogicDriver {
logic_graph: LogicGraph,
Expand Down
7 changes: 5 additions & 2 deletions cosmos_core/src/logic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl LogicBlock {
/// Returns an iterator over every wire color ID any wire face of this block connects to.
///
/// Returns the iterator over all wire color IDs if any of the faces are logic bus.
pub fn wire_face_colors<'a>(&'a self, logic_wire_colors: &'a Registry<LogicWireColor>) -> Box<dyn Iterator<Item = u16> + '_> {
pub fn wire_face_colors<'a>(&'a self, logic_wire_colors: &'a Registry<LogicWireColor>) -> Box<dyn Iterator<Item = u16> + 'a> {
if self.faces_with(Some(LogicConnection::Wire(WireType::Bus))).next().is_some() {
Box::new(logic_wire_colors.all_ids())
} else {
Expand Down Expand Up @@ -312,7 +312,10 @@ impl QueueLogicOutputEvent {
}

#[derive(Component, Clone, Copy, Reflect, PartialEq, Eq, Debug, Default)]
/// The logic signal this block is holding. Note: each block might interact with this data slightly differently.
/// The logic signal this block is holding.
///
/// NOTE: Each block might interact with this data slightly differently.
///
/// Usually, a block with an output port will calculate this value the frame before outputting it and store it here.
pub struct BlockLogicData(pub i32);

Expand Down
2 changes: 1 addition & 1 deletion cosmos_core/src/structure/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ impl ChunkSetEvent {
/// Iterates over all the blocks of this structure.
///
/// * `include_air` If this is true, air blocks will be included. If false, they will not be
pub fn iter_blocks<'a>(&'a self, structure: &'a Structure, include_air: bool) -> BlockIterator {
pub fn iter_blocks<'a>(&'a self, structure: &'a Structure, include_air: bool) -> BlockIterator<'a> {
structure.block_iter_for_chunk(self.coords, include_air)
}
}
Expand Down
3 changes: 2 additions & 1 deletion cosmos_core/src/structure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,8 @@ impl Display for RotationError {
}
}

/// Takes block coordinates, offsets, and the side of the planet you're on. Returns the result of applying the offsets.
/// Takes block coordinates, offsets, and the side of the planet you're on and returns the result of applying the offsets.
///
/// On the +y (Top) side, the offsets affect their corresponding coordinate.
/// On other sides, the offsets affect non-corresponding coordinates and may be flipped negative.
pub fn rotate(
Expand Down
4 changes: 3 additions & 1 deletion cosmos_core/src/structure/systems/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Represents all the systems a structure has. You should access systems a specific structure has
//! through this. It is, however, safe to query systems normally if you don't need a specific structure.
//! through this.
//!
//! It is, however, safe to query systems normally if you don't need a specific structure.
//! If you need information about the structure a system belongs to and you are querying through systems, include
//! the `StructureSystem` component to your query to get the structure's entity.
//!
Expand Down

0 comments on commit cc559d0

Please sign in to comment.