bevy_encase_derive/
lib.rs

1#![expect(missing_docs, reason = "Not all docs are written yet, see #3492.")]
2#![forbid(unsafe_code)]
3#![cfg_attr(docsrs, feature(doc_cfg))]
4#![doc(
5    html_logo_url = "https://bevy.org/assets/icon.png",
6    html_favicon_url = "https://bevy.org/assets/icon.png"
7)]
8
9use bevy_macro_utils::BevyManifest;
10use encase_derive_impl::{implement, syn};
11
12const ENCASE: &str = "encase";
13
14fn bevy_encase_path() -> syn::Path {
15    let bevy_manifest = BevyManifest::shared();
16    bevy_manifest
17        .maybe_get_path("bevy_render")
18        .map(|bevy_render_path| {
19            let mut segments = bevy_render_path.segments;
20            segments.push(BevyManifest::parse_str("render_resource"));
21            syn::Path {
22                leading_colon: None,
23                segments,
24            }
25        })
26        .map(|path| {
27            let mut segments = path.segments;
28            segments.push(BevyManifest::parse_str(ENCASE));
29            syn::Path {
30                leading_colon: None,
31                segments,
32            }
33        })
34        .unwrap_or_else(|| bevy_manifest.get_path(ENCASE))
35}
36
37implement!(bevy_encase_path());