Skip to content

Commit

Permalink
test: Fix failing doc tests.
Browse files Browse the repository at this point in the history
Just added a '&' where needed.
  • Loading branch information
shanecelis committed Sep 22, 2024
1 parent 75ae381 commit 2a018cd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/spatial_query/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use bevy::{ecs::system::SystemParam, prelude::*};
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// ) {
/// println!("First hit: {:?}", first_hit);
/// }
Expand All @@ -50,7 +50,7 @@ use bevy::{ecs::system::SystemParam, prelude::*};
/// 100.0, // Maximum time of impact (travel distance)
/// 20, // Maximum number of hits
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// );
///
/// // Print hits
Expand Down Expand Up @@ -115,7 +115,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// ) {
/// println!("First hit: {:?}", first_hit);
/// }
Expand Down Expand Up @@ -167,7 +167,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// &|entity| { // Predicate
/// // Skip entities with the `Invisible` component.
/// !query.contains(entity)
Expand Down Expand Up @@ -229,7 +229,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// 100.0, // Maximum time of impact (travel distance)
/// 20, // Maximum number of hits
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// );
///
/// // Print hits
Expand Down Expand Up @@ -291,7 +291,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Does the ray treat colliders as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |hit| { // Callback function
/// hits.push(hit);
/// true
Expand Down Expand Up @@ -359,7 +359,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Should initial penetration at the origin be ignored
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// ) {
/// println!("First hit: {:?}", first_hit);
/// }
Expand Down Expand Up @@ -424,7 +424,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// 100.0, // Maximum time of impact (travel distance)
/// 20, // Max hits
/// true, // Should initial penetration at the origin be ignored
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// );
///
/// // Print hits
Expand Down Expand Up @@ -495,7 +495,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// Dir3::X, // Direction
/// 100.0, // Maximum time of impact (travel distance)
/// true, // Should initial penetration at the origin be ignored
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |hit| { // Callback function
/// hits.push(hit);
/// true
Expand Down Expand Up @@ -557,7 +557,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// if let Some(projection) = spatial_query.project_point(
/// Vec3::ZERO, // Point
/// true, // Are colliders treated as "solid"
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// ) {
/// println!("Projection: {:?}", projection);
/// }
Expand Down Expand Up @@ -593,7 +593,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// # #[cfg(all(feature = "3d", feature = "f32"))]
/// fn print_point_intersections(spatial_query: SpatialQuery) {
/// let intersections =
/// spatial_query.point_intersections(Vec3::ZERO, SpatialQueryFilter::default());
/// spatial_query.point_intersections(Vec3::ZERO, &SpatialQueryFilter::default());
///
/// for entity in intersections.iter() {
/// println!("Entity: {:?}", entity);
Expand Down Expand Up @@ -633,7 +633,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
///
/// spatial_query.point_intersections_callback(
/// Vec3::ZERO, // Point
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |entity| { // Callback function
/// intersections.push(entity);
/// true
Expand Down Expand Up @@ -745,7 +745,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// &Collider::sphere(0.5), // Shape
/// Vec3::ZERO, // Shape position
/// Quat::default(), // Shape rotation
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// );
///
/// for entity in intersections.iter() {
Expand Down Expand Up @@ -793,7 +793,7 @@ impl<'w, 's> SpatialQuery<'w, 's> {
/// &Collider::sphere(0.5), // Shape
/// Vec3::ZERO, // Shape position
/// Quat::default(), // Shape rotation
/// SpatialQueryFilter::default(), // Query filter
/// &SpatialQueryFilter::default(), // Query filter
/// |entity| { // Callback function
/// intersections.push(entity);
/// true
Expand Down

0 comments on commit 2a018cd

Please sign in to comment.