Skip to content

Commit c63d4ca

Browse files
authored
refactor!: remove items marked as deprecated in 0.2.1 (#64)
* refactor: remove deprecated utils functions * refactor: remove get_mut methods of the respective attribute storage * refactor: update UG & add utils feature to the doc CI * doc: clarify doc & remove mention of single_precision
1 parent 37c4252 commit c63d4ca

File tree

6 files changed

+14
-83
lines changed

6 files changed

+14
-83
lines changed

.github/workflows/doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
- name: Generate User Guide
3131
run: mdbook build -d ../target/doc/ honeycomb-guide/
3232
- name: Generate Rust Docs
33-
run: cargo doc --all --no-deps
34-
33+
run: cargo doc --all --no-deps --features utils
34+
3535
- name: Deploy Docs
3636
uses: peaceiris/actions-gh-pages@v3
3737
with:

honeycomb-core/src/attributes/collections.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,6 @@ impl<T: AttributeBind + AttributeUpdate> AttrSparseVec<T> {
8989
&self.data[index.to_usize().unwrap()]
9090
}
9191

92-
/// Getter
93-
///
94-
/// # Arguments
95-
///
96-
/// - `index: T::IdentifierType` -- Cell index.
97-
///
98-
/// # Return
99-
///
100-
/// Return a mutable reference to the value indexed by `index`.
101-
///
102-
/// # Panics
103-
///
104-
/// The method may panic if:
105-
/// - the index lands out of bounds
106-
/// - the index cannot be converted to `usize`
107-
///
108-
#[deprecated]
109-
pub fn get_mut(&mut self, index: &T::IdentifierType) -> &mut Option<T> {
110-
&mut self.data[index.to_usize().unwrap()]
111-
}
112-
11392
/// Setter
11493
///
11594
/// Set the value of an element at a given index.
@@ -314,28 +293,6 @@ impl<T: AttributeBind + AttributeUpdate + Clone> AttrCompactVec<T> {
314293
self.index_map[index.to_usize().unwrap()].map(|idx| &self.data[idx])
315294
}
316295

317-
/// Getter
318-
///
319-
/// # Arguments
320-
///
321-
/// - `index: T::IdentifierType` -- Cell index.
322-
///
323-
/// # Return
324-
///
325-
/// Return an `Option` that may contain a mutable reference to the value associated to `index`,
326-
/// if it exists.
327-
///
328-
/// # Panics
329-
///
330-
/// The method may panic if:
331-
/// - the index lands out of bounds
332-
/// - the index cannot be converted to `usize`
333-
///
334-
#[deprecated]
335-
pub fn get_mut(&mut self, index: &T::IdentifierType) -> Option<&mut T> {
336-
self.index_map[index.to_usize().unwrap()].map(|idx| &mut self.data[idx])
337-
}
338-
339296
/// Setter
340297
///
341298
/// Set the value of an element at a given index.

honeycomb-core/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
//! This crate implements all basic structure and methods for
44
//! 2D and 3D combinatorial map modeling.
55
//!
6-
//! This documentation focus on the implementation side of things
7-
//! and API usage, for more formal information about combinatorial
8-
//! maps, refer to the **Definitions** section of the user guide.
6+
//! This documentation focus on the implementation side of things and API usage, for more
7+
//! formal information about combinatorial maps, refer to the **Definitions** section of
8+
//! the [user guide][UG].
9+
//!
10+
//! [UG]:https://lihpc-computational-geometry.github.io/honeycomb/
911
//!
1012
//! ## Features
1113
//!
1214
//! Optional features can be enabled when compiling this crate:
1315
//!
14-
//! - `utils` -- provides additionnal methods for benchmarking and debugging
16+
//! - `utils` -- provides additionnal implementations for map generation, benchmarking & debugging
1517
//! - `single_precision` -- uses `f32` instead of `f64` for coordinates representation in tests
1618
1719
// ------ CUSTOM LINTS

honeycomb-core/src/utils/generation.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -513,38 +513,6 @@ impl<T: CoordsFloat> GridBuilder<T> {
513513
}
514514
}
515515

516-
/// Generate a [`CMap2`] representing a mesh made up of squares.
517-
///
518-
/// <div class="warning">
519-
///
520-
/// **This function is deprecated, please use [`GridBuilder::unit_squares`] instead.**
521-
///
522-
/// </div>
523-
///
524-
/// This function builds and returns a 2-map representing a square mesh
525-
/// made of `n_square * n_square` square cells.
526-
#[deprecated(note = "please use the `GridBuilder::unit_squares` function instead")]
527-
#[must_use = "constructed object is not used, consider removing this function call"]
528-
pub fn square_cmap2<T: CoordsFloat>(n_square: usize) -> CMap2<T> {
529-
build2_grid([n_square, n_square], [T::one(), T::one()])
530-
}
531-
532-
/// Generate a [`CMap2`] representing a mesh made up of squares split diagonally.
533-
///
534-
/// <div class="warning">
535-
///
536-
/// **This function is deprecated, please use [`GridBuilder::unit_squares`] instead.**
537-
///
538-
/// </div>
539-
///
540-
/// This function builds and returns a 2-map representing a square mesh
541-
/// made of `n_square * n_square * 2` triangle cells.
542-
#[deprecated(note = "please use the `GridBuilder::split_unit_squares` function instead")]
543-
#[must_use = "constructed object is not used, consider removing this function call"]
544-
pub fn splitsquare_cmap2<T: CoordsFloat>(n_square: usize) -> CMap2<T> {
545-
build2_splitgrid([n_square, n_square], [T::one(), T::one()])
546-
}
547-
548516
// ------ TESTS
549517

550518
#[cfg(test)]

honeycomb-core/src/utils/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ mod generation;
1515

1616
// ------ PUBLIC RE-EXPORTS
1717

18-
#[allow(deprecated)]
19-
pub use generation::{splitsquare_cmap2, square_cmap2, GridBuilder};
18+
pub use generation::GridBuilder;

honeycomb-guide/src/project-structure/honeycomb-core.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ A quickstart example encompassing most features is provided for the following st
1414
- [CMap2](../honeycomb_core/struct.CMap2.html#example)
1515
- [Vector2](../honeycomb_core/struct.Vector2.html#example)
1616
- [Vertex2](../honeycomb_core/struct.Vertex2.html#example)
17+
- [GridBuilder](../honeycomb_core/utils/struct.GridBuilder.html#example)
1718

1819
## Content
1920

@@ -24,3 +25,7 @@ following:
2425
- **Orbit2**: Generic 2D implementation for orbit computation
2526
- **Vector2**: 2D vector representation
2627
- **Vertex2**: 2D vertex representation
28+
29+
Note that optional features can be enabled when compiling this crate:
30+
31+
- `utils` -- provides additionnal implementations for map generation, benchmarking & debugging

0 commit comments

Comments
 (0)