Skip to content

Commit 07dc83d

Browse files
committed
Fix warnings
1 parent 8b326e7 commit 07dc83d

File tree

4 files changed

+23
-25
lines changed

4 files changed

+23
-25
lines changed

splashsurf_lib/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ repository = "https://github.com/InteractiveComputerGraphics/splashsurf"
1414
documentation = "https://docs.rs/splashsurf_lib"
1515

1616
[package.metadata.docs.rs]
17-
# RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --no-deps --open
17+
# RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --no-deps --open
1818
# Build with all features to properly document everything
1919
all-features = true
20-
# Run with specific configuration for special doc attributes
21-
rustdoc-args = ["--cfg", "doc_cfg"]
2220
# Build only for a single target as this crate does not have any platform specific behavior
2321
default-target = "x86_64-unknown-linux-gnu"
2422
targets = []

splashsurf_lib/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(doc_cfg, feature(doc_cfg))]
1+
#![cfg_attr(docsrs, feature(doc_cfg))]
22

33
//!
44
//! Library for surface reconstruction of SPH particle data using marching cubes.
@@ -46,7 +46,7 @@ use crate::uniform_grid::GridConstructionError;
4646
use crate::workspace::ReconstructionWorkspace;
4747

4848
#[cfg(feature = "profiling")]
49-
#[cfg_attr(doc_cfg, doc(cfg(feature = "profiling")))]
49+
#[cfg_attr(docsrs, doc(cfg(feature = "profiling")))]
5050
pub mod profiling;
5151
#[doc(hidden)]
5252
pub mod profiling_macro;
@@ -57,7 +57,7 @@ pub mod density_map;
5757
pub mod generic_tree;
5858
pub mod halfedge_mesh;
5959
#[cfg(feature = "io")]
60-
#[cfg_attr(doc_cfg, doc(cfg(feature = "io")))]
60+
#[cfg_attr(docsrs, doc(cfg(feature = "io")))]
6161
pub mod io;
6262
pub mod kernel;
6363
pub mod marching_cubes;

splashsurf_lib/src/mesh.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ impl<R: Real> MeshAttribute<R> {
13731373

13741374
/// Converts the mesh attribute to a [`vtkio::model::Attribute`])
13751375
#[cfg(feature = "vtk_extras")]
1376-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1376+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
13771377
fn to_vtk_attribute(&self) -> Attribute {
13781378
match &self.data {
13791379
AttributeData::ScalarU64(u64_vec) => {
@@ -1433,7 +1433,7 @@ where
14331433
for<'a> &'a MeshT: IntoVtkUnstructuredGridPiece,
14341434
{
14351435
/// Creates a [`vtkio::model::UnstructuredGridPiece`] representing this mesh including its attached [`MeshAttribute`]s
1436-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1436+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14371437
fn unstructured_grid(&self) -> UnstructuredGridPiece {
14381438
let mut grid_piece: UnstructuredGridPiece = (&self.mesh).into_unstructured_grid();
14391439
for point_attribute in &self.point_attributes {
@@ -1452,55 +1452,55 @@ where
14521452
macro_rules! impl_into_vtk {
14531453
($name:tt) => {
14541454
#[cfg(feature = "vtk_extras")]
1455-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1455+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14561456
impl<R: Real> IntoVtkUnstructuredGridPiece for $name<R> {
14571457
fn into_unstructured_grid(self) -> UnstructuredGridPiece {
14581458
vtk_helper::mesh_to_unstructured_grid(&self)
14591459
}
14601460
}
14611461

14621462
#[cfg(feature = "vtk_extras")]
1463-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1463+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14641464
impl<R: Real> IntoVtkUnstructuredGridPiece for &$name<R> {
14651465
fn into_unstructured_grid(self) -> UnstructuredGridPiece {
14661466
vtk_helper::mesh_to_unstructured_grid(self)
14671467
}
14681468
}
14691469

14701470
#[cfg(feature = "vtk_extras")]
1471-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1471+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14721472
impl<'a, R: Real> IntoVtkUnstructuredGridPiece for std::borrow::Cow<'a, $name<R>> {
14731473
fn into_unstructured_grid(self) -> UnstructuredGridPiece {
14741474
vtk_helper::mesh_to_unstructured_grid(&self)
14751475
}
14761476
}
14771477

14781478
#[cfg(feature = "vtk_extras")]
1479-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1479+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14801480
impl<'a, R: Real> IntoVtkUnstructuredGridPiece for &std::borrow::Cow<'a, $name<R>> {
14811481
fn into_unstructured_grid(self) -> UnstructuredGridPiece {
14821482
vtk_helper::mesh_to_unstructured_grid(self)
14831483
}
14841484
}
14851485

14861486
#[cfg(feature = "vtk_extras")]
1487-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1487+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14881488
impl<R: Real> IntoVtkUnstructuredGridPiece for &MeshWithData<R, $name<R>> {
14891489
fn into_unstructured_grid(self) -> UnstructuredGridPiece {
14901490
self.unstructured_grid()
14911491
}
14921492
}
14931493

14941494
#[cfg(feature = "vtk_extras")]
1495-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1495+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
14961496
impl<R: Real> IntoVtkUnstructuredGridPiece for MeshWithData<R, $name<R>> {
14971497
fn into_unstructured_grid(self) -> UnstructuredGridPiece {
14981498
self.unstructured_grid()
14991499
}
15001500
}
15011501

15021502
#[cfg(feature = "vtk_extras")]
1503-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1503+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15041504
impl<'a, R: Real> IntoVtkUnstructuredGridPiece
15051505
for &MeshWithData<R, std::borrow::Cow<'a, $name<R>>>
15061506
{
@@ -1518,7 +1518,7 @@ impl_into_vtk!(PointCloud3d);
15181518

15191519
/// Trait implementations to convert meshes into types supported by [`vtkio`]
15201520
#[cfg(feature = "vtk_extras")]
1521-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1521+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15221522
pub mod vtk_helper {
15231523
use vtkio::model::{
15241524
Attributes, CellType, Cells, DataSet, UnstructuredGridPiece, VertexNumbers,
@@ -1530,20 +1530,20 @@ pub mod vtk_helper {
15301530
};
15311531

15321532
/// Trait that can be implemented by mesh cells to return the corresponding [`vtkio::model::CellType`]
1533-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1533+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15341534
pub trait HasVtkCellType {
15351535
/// Returns the corresponding [`vtkio::model::CellType`] of the cell
15361536
fn vtk_cell_type(&self) -> CellType;
15371537
}
15381538

1539-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1539+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15401540
impl HasVtkCellType for TriangleCell {
15411541
fn vtk_cell_type(&self) -> CellType {
15421542
CellType::Triangle
15431543
}
15441544
}
15451545

1546-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1546+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15471547
impl HasVtkCellType for TriangleOrQuadCell {
15481548
fn vtk_cell_type(&self) -> CellType {
15491549
match self {
@@ -1553,28 +1553,28 @@ pub mod vtk_helper {
15531553
}
15541554
}
15551555

1556-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1556+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15571557
impl HasVtkCellType for HexCell {
15581558
fn vtk_cell_type(&self) -> CellType {
15591559
CellType::Hexahedron
15601560
}
15611561
}
15621562

1563-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1563+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15641564
impl HasVtkCellType for PointCell {
15651565
fn vtk_cell_type(&self) -> CellType {
15661566
CellType::Vertex
15671567
}
15681568
}
15691569

15701570
/// Conversion of meshes into a [`vtkio::model::UnstructuredGridPiece`]
1571-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1571+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15721572
pub trait IntoVtkUnstructuredGridPiece {
15731573
fn into_unstructured_grid(self) -> UnstructuredGridPiece;
15741574
}
15751575

15761576
/// Direct conversion of meshes into a full [`vtkio::model::DataSet`]
1577-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1577+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
15781578
pub trait IntoVtkDataSet {
15791579
fn into_dataset(self) -> DataSet;
15801580
}
@@ -1598,7 +1598,7 @@ pub mod vtk_helper {
15981598
}
15991599

16001600
/// Converts any supported mesh to a [`vtkio::model::UnstructuredGridPiece`]
1601-
#[cfg_attr(doc_cfg, doc(cfg(feature = "vtk_extras")))]
1601+
#[cfg_attr(docsrs, doc(cfg(feature = "vtk_extras")))]
16021602
pub fn mesh_to_unstructured_grid<'a, R, MeshT>(mesh: &'a MeshT) -> UnstructuredGridPiece
16031603
where
16041604
R: Real,

splashsurf_lib/src/profiling_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
/// profile!(inner_id, "inner scope", parent = outer_id);
7171
/// ```
7272
#[macro_export]
73-
#[cfg_attr(doc_cfg, doc(cfg(feature = "profiling")))]
73+
#[cfg_attr(docsrs, doc(cfg(feature = "profiling")))]
7474
macro_rules! profile {
7575
($name:expr) => {
7676
use $crate::profile_impl;

0 commit comments

Comments
 (0)