Skip to content

Commit

Permalink
Merge commit '786abbf3f5e5be4b89c6b53d2d03162079f8e1f4' into miscthings
Browse files Browse the repository at this point in the history
  • Loading branch information
JMS55 committed Dec 30, 2023
2 parents 72721f5 + 786abbf commit 2344715
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/validation-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: install xvfb, llvmpipe and lavapipe
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo add-apt-repository ppa:kisak/turtle -y
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
- uses: actions/checkout@v4
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
- name: install xvfb, llvmpipe and lavapipe
run: |
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo add-apt-repository ppa:kisak/turtle -y
sudo apt-get update
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_ecs/src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ impl Entities {
/// Reserve entity IDs concurrently.
///
/// Storage for entity generation and location is lazily allocated by calling [`flush`](Entities::flush).
#[allow(clippy::unnecessary_fallible_conversions)] // Because `IdCursor::try_from` may fail on 32-bit platforms.
pub fn reserve_entities(&self, count: u32) -> ReserveEntitiesIterator {
// Use one atomic subtract to grab a range of new IDs. The range might be
// entirely nonnegative, meaning all IDs come from the freelist, or entirely
Expand Down Expand Up @@ -627,6 +628,7 @@ impl Entities {
}

/// Ensure at least `n` allocations can succeed without reallocating.
#[allow(clippy::unnecessary_fallible_conversions)] // Because `IdCursor::try_from` may fail on 32-bit platforms.
pub fn reserve(&mut self, additional: u32) {
self.verify_flushed();

Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_ecs/src/query/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
}

/// Runs `func` on each query result for the given [`World`]. This is faster than the equivalent
/// iter() method, but cannot be chained like a normal [`Iterator`].
/// `iter()` method, but cannot be chained like a normal [`Iterator`].
///
/// This can only be called for read-only queries, see [`Self::for_each_mut`] for write-queries.
///
Expand Down Expand Up @@ -1024,7 +1024,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
}

/// Runs `func` on each query result for the given [`World`]. This is faster than the equivalent
/// iter() method, but cannot be chained like a normal [`Iterator`].
/// `iter()` method, but cannot be chained like a normal [`Iterator`].
///
/// # Safety
///
Expand Down Expand Up @@ -1086,7 +1086,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {

/// Runs `func` on each query result in parallel for the given [`World`], where the last change and
/// the current change tick are given. This is faster than the equivalent
/// iter() method, but cannot be chained like a normal [`Iterator`].
/// `iter()` method, but cannot be chained like a normal [`Iterator`].
///
/// # Panics
/// The [`ComputeTaskPool`] is not initialized. If using this from a query that is being
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/storage/blob_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ impl BlobVec {
/// The removed element is replaced by the last element of the `BlobVec`.
///
/// # Safety
/// It is the caller's responsibility to ensure that `index` is < self.len()
/// It is the caller's responsibility to ensure that `index` is `< self.len()`.
#[inline]
pub unsafe fn swap_remove_and_drop_unchecked(&mut self, index: usize) {
debug_assert!(index < self.len());
Expand Down
3 changes: 2 additions & 1 deletion crates/bevy_gltf/src/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ fn load_material(
}

/// Loads a glTF node.
#[allow(clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments, clippy::result_large_err)]
fn load_node(
gltf_node: &Node,
world_builder: &mut WorldChildBuilder,
Expand Down Expand Up @@ -1291,6 +1291,7 @@ fn texture_address_mode(gltf_address_mode: &WrappingMode) -> ImageAddressMode {
}

/// Maps the `primitive_topology` form glTF to `wgpu`.
#[allow(clippy::result_large_err)]
fn get_primitive_topology(mode: Mode) -> Result<PrimitiveTopology, GltfError> {
match mode {
Mode::Points => Ok(PrimitiveTopology::PointList),
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/impls/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ impl<T: FromReflect + Clone + TypePath> FromReflect for Cow<'static, [T]> {
for field in ref_list.iter() {
temp_vec.push(T::from_reflect(field)?);
}
temp_vec.try_into().ok()
Some(temp_vec.into())
} else {
None
}
Expand Down
12 changes: 6 additions & 6 deletions crates/bevy_ui/src/ui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ impl GridTrack {
.into()
}

/// Create a fit-content() grid track with fixed pixel limit
/// Create a `fit-content()` grid track with fixed pixel limit.
///
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content_function>
pub fn fit_content_px<T: From<Self>>(limit: f32) -> T {
Expand All @@ -1046,7 +1046,7 @@ impl GridTrack {
.into()
}

/// Create a fit-content() grid track with percentage limit
/// Create a `fit-content()` grid track with percentage limit.
///
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content_function>
pub fn fit_content_percent<T: From<Self>>(limit: f32) -> T {
Expand All @@ -1057,7 +1057,7 @@ impl GridTrack {
.into()
}

/// Create a minmax() grid track
/// Create a `minmax()` grid track.
///
/// <https://developer.mozilla.org/en-US/docs/Web/CSS/minmax>
pub fn minmax<T: From<Self>>(min: MinTrackSizingFunction, max: MaxTrackSizingFunction) -> T {
Expand Down Expand Up @@ -1198,7 +1198,7 @@ impl RepeatedGridTrack {
.into()
}

/// Create a repeating set of fit-content() grid tracks with fixed pixel limit
/// Create a repeating set of `fit-content()` grid tracks with fixed pixel limit
pub fn fit_content_px<T: From<Self>>(repetition: u16, limit: f32) -> T {
Self {
repetition: GridTrackRepetition::Count(repetition),
Expand All @@ -1207,7 +1207,7 @@ impl RepeatedGridTrack {
.into()
}

/// Create a repeating set of fit-content() grid tracks with percentage limit
/// Create a repeating set of `fit-content()` grid tracks with percentage limit
pub fn fit_content_percent<T: From<Self>>(repetition: u16, limit: f32) -> T {
Self {
repetition: GridTrackRepetition::Count(repetition),
Expand All @@ -1216,7 +1216,7 @@ impl RepeatedGridTrack {
.into()
}

/// Create a repeating set of minmax() grid track
/// Create a repeating set of `minmax()` grid track
pub fn minmax<T: From<Self>>(
repetition: impl Into<GridTrackRepetition>,
min: MinTrackSizingFunction,
Expand Down
5 changes: 1 addition & 4 deletions crates/bevy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,8 @@ pub struct Hashed<V, H = FixedState> {
impl<V: Hash, H: BuildHasher + Default> Hashed<V, H> {
/// Pre-hashes the given value using the [`BuildHasher`] configured in the [`Hashed`] type.
pub fn new(value: V) -> Self {
let builder = H::default();
let mut hasher = builder.build_hasher();
value.hash(&mut hasher);
Self {
hash: hasher.finish(),
hash: H::default().hash_one(&value),
value,
marker: PhantomData,
}
Expand Down
15 changes: 6 additions & 9 deletions examples/3d/transmission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,12 @@ fn setup(

let plane_mesh = meshes.add(shape::Plane::from_size(2.0).into());

let cylinder_mesh = meshes.add(
Mesh::try_from(shape::Cylinder {
radius: 0.5,
height: 2.0,
resolution: 50,
segments: 1,
})
.unwrap(),
);
let cylinder_mesh = meshes.add(Mesh::from(shape::Cylinder {
radius: 0.5,
height: 2.0,
resolution: 50,
segments: 1,
}));

// Cube #1
commands.spawn((
Expand Down

0 comments on commit 2344715

Please sign in to comment.