diff options
author | 2023-09-09 20:58:45 +0200 | |
---|---|---|
committer | 2023-09-09 20:58:45 +0200 | |
commit | f60884f6f8639f75258c264bf4a15591351ef05b (patch) | |
tree | ee0d8c6a8b29c648d9e6312bc8690f38fdf354f3 | |
parent | 89d9f1d7d2202029028a487df1dd11b0665a7517 (diff) | |
download | iced-f60884f6f8639f75258c264bf4a15591351ef05b.tar.gz iced-f60884f6f8639f75258c264bf4a15591351ef05b.tar.bz2 iced-f60884f6f8639f75258c264bf4a15591351ef05b.zip |
Deny `broken_intradoc_links` and verify documentation in CI
-rw-r--r-- | .github/workflows/document.yml | 6 | ||||
-rw-r--r-- | core/src/lib.rs | 5 | ||||
-rw-r--r-- | futures/src/lib.rs | 5 | ||||
-rw-r--r-- | graphics/src/lib.rs | 5 | ||||
-rw-r--r-- | renderer/src/lib.rs | 13 | ||||
-rw-r--r-- | runtime/src/lib.rs | 5 | ||||
-rw-r--r-- | src/lib.rs | 5 | ||||
-rw-r--r-- | style/src/lib.rs | 8 | ||||
-rw-r--r-- | tiny_skia/src/geometry.rs | 2 | ||||
-rw-r--r-- | tiny_skia/src/lib.rs | 13 | ||||
-rw-r--r-- | tiny_skia/src/raster.rs | 4 | ||||
-rw-r--r-- | tiny_skia/src/text.rs | 6 | ||||
-rw-r--r-- | tiny_skia/src/vector.rs | 8 | ||||
-rw-r--r-- | tiny_skia/src/window/compositor.rs | 1 | ||||
-rw-r--r-- | wgpu/src/lib.rs | 5 | ||||
-rw-r--r-- | widget/src/lib.rs | 5 | ||||
-rw-r--r-- | winit/src/lib.rs | 5 |
17 files changed, 68 insertions, 33 deletions
diff --git a/.github/workflows/document.yml b/.github/workflows/document.yml index 09a7a4d5..230c5cb0 100644 --- a/.github/workflows/document.yml +++ b/.github/workflows/document.yml @@ -1,8 +1,5 @@ name: Document -on: - push: - branches: - - master +on: [push, pull_request] jobs: all: runs-on: ubuntu-20.04 @@ -31,6 +28,7 @@ jobs: - name: Write CNAME file run: echo 'docs.iced.rs' > ./target/doc/CNAME - name: Publish documentation + if: github.ref == 'refs/heads/master' uses: peaceiris/actions-gh-pages@v3 with: deploy_key: ${{ secrets.DOCS_DEPLOY_KEY }} diff --git a/core/src/lib.rs b/core/src/lib.rs index c1c8424b..1bfba7bd 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -9,6 +9,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(unsafe_code, rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -17,9 +18,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] pub mod alignment; pub mod clipboard; diff --git a/futures/src/lib.rs b/futures/src/lib.rs index 8e75331f..abc46176 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -4,6 +4,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(unsafe_code, rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -12,9 +13,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use futures; diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index af374a2f..4e814eb0 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -7,6 +7,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -16,9 +17,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] mod antialiasing; diff --git a/renderer/src/lib.rs b/renderer/src/lib.rs index 7d1a02c2..6dcc0e96 100644 --- a/renderer/src/lib.rs +++ b/renderer/src/lib.rs @@ -1,3 +1,16 @@ +#![forbid(rust_2018_idioms)] +#![deny( + unsafe_code, + unused_results, + clippy::extra_unused_lifetimes, + clippy::from_over_into, + clippy::needless_borrow, + clippy::new_without_default, + clippy::useless_conversion, + rustdoc::broken_intra_doc_links +)] +#![allow(clippy::inherent_to_string, clippy::type_complexity)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod compositor; #[cfg(feature = "geometry")] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index dc631d47..c3261cca 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -8,6 +8,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(unsafe_code, rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -16,9 +17,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(unsafe_code, rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod clipboard; pub mod command; @@ -151,6 +151,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(rust_2018_idioms, unsafe_code)] #![deny( missing_debug_implementations, missing_docs, @@ -159,9 +160,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(rust_2018_idioms, unsafe_code)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] use iced_widget::graphics; diff --git a/style/src/lib.rs b/style/src/lib.rs index 286ff9db..0c555ed8 100644 --- a/style/src/lib.rs +++ b/style/src/lib.rs @@ -7,16 +7,18 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(unsafe_code, rust_2018_idioms)] #![deny( unused_results, clippy::extra_unused_lifetimes, clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + missing_docs, + unused_results, + rustdoc::broken_intra_doc_links )] -#![deny(missing_docs, unused_results)] -#![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] pub use iced_core as core; diff --git a/tiny_skia/src/geometry.rs b/tiny_skia/src/geometry.rs index 1df5aa18..047bc0ff 100644 --- a/tiny_skia/src/geometry.rs +++ b/tiny_skia/src/geometry.rs @@ -303,7 +303,7 @@ pub fn into_fill_rule(rule: fill::Rule) -> tiny_skia::FillRule { } } -pub fn into_stroke(stroke: &Stroke) -> tiny_skia::Stroke { +pub fn into_stroke(stroke: &Stroke<'_>) -> tiny_skia::Stroke { tiny_skia::Stroke { width: stroke.width, line_cap: match stroke.line_cap { diff --git a/tiny_skia/src/lib.rs b/tiny_skia/src/lib.rs index 15de6ce2..e48468e9 100644 --- a/tiny_skia/src/lib.rs +++ b/tiny_skia/src/lib.rs @@ -1,3 +1,16 @@ +#![forbid(rust_2018_idioms)] +#![deny( + unsafe_code, + unused_results, + clippy::extra_unused_lifetimes, + clippy::from_over_into, + clippy::needless_borrow, + clippy::new_without_default, + clippy::useless_conversion, + rustdoc::broken_intra_doc_links +)] +#![allow(clippy::inherent_to_string, clippy::type_complexity)] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod window; mod backend; diff --git a/tiny_skia/src/raster.rs b/tiny_skia/src/raster.rs index dedb127c..d13b1167 100644 --- a/tiny_skia/src/raster.rs +++ b/tiny_skia/src/raster.rs @@ -85,14 +85,14 @@ impl Cache { ); } - entry.insert(Some(Entry { + let _ = entry.insert(Some(Entry { width: image.width(), height: image.height(), pixels: buffer, })); } - self.hits.insert(id); + let _ = self.hits.insert(id); self.entries.get(&id).unwrap().as_ref().map(|entry| { tiny_skia::PixmapRef::from_bytes( bytemuck::cast_slice(&entry.pixels), diff --git a/tiny_skia/src/text.rs b/tiny_skia/src/text.rs index 306b400a..dabbe952 100644 --- a/tiny_skia/src/text.rs +++ b/tiny_skia/src/text.rs @@ -32,7 +32,7 @@ impl Pipeline { } pub fn load_font(&mut self, bytes: Cow<'static, [u8]>) { - self.font_system.get_mut().db_mut().load_font_source( + let _ = self.font_system.get_mut().db_mut().load_font_source( cosmic_text::fontdb::Source::Binary(Arc::new(bytes.into_owned())), ); @@ -335,10 +335,10 @@ impl GlyphCache { } } - entry.insert((buffer, image.placement)); + let _ = entry.insert((buffer, image.placement)); } - self.recently_used.insert(key); + let _ = self.recently_used.insert(key); self.entries.get(&key).map(|(buffer, placement)| { (bytemuck::cast_slice(buffer.as_slice()), *placement) diff --git a/tiny_skia/src/vector.rs b/tiny_skia/src/vector.rs index 433ca0f5..490b9f69 100644 --- a/tiny_skia/src/vector.rs +++ b/tiny_skia/src/vector.rs @@ -92,10 +92,10 @@ impl Cache { } }; - entry.insert(svg); + let _ = entry.insert(svg); } - self.tree_hits.insert(id); + let _ = self.tree_hits.insert(id); self.trees.get(&id).unwrap().as_ref() } @@ -178,10 +178,10 @@ impl Cache { } } - self.rasters.insert(key, image); + let _ = self.rasters.insert(key, image); } - self.raster_hits.insert(key); + let _ = self.raster_hits.insert(key); self.rasters.get(&key).map(tiny_skia::Pixmap::as_ref) } diff --git a/tiny_skia/src/window/compositor.rs b/tiny_skia/src/window/compositor.rs index 775cf9e5..c0da5142 100644 --- a/tiny_skia/src/window/compositor.rs +++ b/tiny_skia/src/window/compositor.rs @@ -39,6 +39,7 @@ impl<Theme> crate::graphics::Compositor for Compositor<Theme> { width: u32, height: u32, ) -> Surface { + #[allow(unsafe_code)] let window = unsafe { softbuffer::GraphicsContext::new(window, window) } .expect("Create softbuffer for window"); diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs index d1e4b7af..b9f54560 100644 --- a/wgpu/src/lib.rs +++ b/wgpu/src/lib.rs @@ -20,6 +20,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -29,9 +30,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub mod layer; diff --git a/widget/src/lib.rs b/widget/src/lib.rs index 316e8829..5cb0f8de 100644 --- a/widget/src/lib.rs +++ b/widget/src/lib.rs @@ -2,6 +2,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(unsafe_code, rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -10,9 +11,9 @@ clippy::from_over_into, clippy::needless_borrow, clippy::new_without_default, - clippy::useless_conversion + clippy::useless_conversion, + rustdoc::broken_intra_doc_links )] -#![forbid(unsafe_code, rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use iced_renderer as renderer; diff --git a/winit/src/lib.rs b/winit/src/lib.rs index 1a87ca11..9852a182 100644 --- a/winit/src/lib.rs +++ b/winit/src/lib.rs @@ -17,6 +17,7 @@ #![doc( html_logo_url = "https://raw.githubusercontent.com/iced-rs/iced/9ab6923e943f784985e9ef9ca28b10278297225d/docs/logo.svg" )] +#![forbid(rust_2018_idioms)] #![deny( missing_debug_implementations, missing_docs, @@ -26,9 +27,9 @@ clippy::needless_borrow, clippy::new_without_default, clippy::useless_conversion, - unsafe_code + unsafe_code, + rustdoc::broken_intra_doc_links )] -#![forbid(rust_2018_idioms)] #![allow(clippy::inherent_to_string, clippy::type_complexity)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use iced_graphics as graphics; |