From 936804eb2c879528ce9e1e63847ddeb558174d09 Mon Sep 17 00:00:00 2001 From: Andreas Hartmann Date: Tue, 13 Feb 2024 07:05:40 +0100 Subject: [PATCH] chore: Fix warnings during docs build and make sure that `cross_toml` shows up as part of the official documentation along the way. --- src/cross_toml.rs | 7 ++++++- src/docker/engine.rs | 2 +- src/docker/image.rs | 2 +- src/lib.rs | 5 +++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/cross_toml.rs b/src/cross_toml.rs index b200abf79..c78a812a0 100644 --- a/src/cross_toml.rs +++ b/src/cross_toml.rs @@ -1,4 +1,9 @@ -#![doc = include_str!("../docs/config_file.md")] +//! The `Cross.toml` configuration file. +//! +//! For a detailed user documentation of the file and the contents please refer to the [docs in the +//! repo][1]. +//! +//! [1]: https://github.com/har7an/cross/blob/docs/restructure-docs-folder/docs/config_file.md use crate::docker::custom::PreBuild; use crate::docker::PossibleImage; diff --git a/src/docker/engine.rs b/src/docker/engine.rs index 0b65d05d1..0e42cb3f1 100644 --- a/src/docker/engine.rs +++ b/src/docker/engine.rs @@ -51,7 +51,7 @@ impl EngineType { /// Some container engines, especially podman, do not support the `type` /// key of `--cache-from` during the image build steps. They also do /// not support any tags for the `--cache-from` steps either. See: - /// https://docs.podman.io/en/latest/markdown/podman-build.1.html#cache-from + /// #[must_use] pub const fn supports_cache_from_type(&self) -> bool { matches!(self, Self::Docker | Self::Nerdctl) diff --git a/src/docker/image.rs b/src/docker/image.rs index cbce5c066..e1ff332bf 100644 --- a/src/docker/image.rs +++ b/src/docker/image.rs @@ -103,7 +103,7 @@ impl std::fmt::Display for PossibleImage { } /// The architecture/platform to use in the image /// -/// https://github.com/containerd/containerd/blob/release/1.6/platforms/platforms.go#L63 +/// #[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)] #[serde(try_from = "String")] pub struct ImagePlatform { diff --git a/src/lib.rs b/src/lib.rs index f10607e3a..08fe42c24 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,8 @@ //! ⚠️ Warning: The cross library is for internal //! use only: only the command-line interface is stable. The library //! may change at any point for any reason. For documentation on the -//! CLI, please see the repository README +//! CLI, please see the repository README, +//! docs folder //! or the wiki. //!

@@ -33,7 +34,7 @@ mod tests; pub mod cargo; pub mod cli; pub mod config; -mod cross_toml; +pub mod cross_toml; pub mod docker; pub mod errors; mod extensions;