Skip to content

Commit f065a90

Browse files
committed
remove inactive docs code
1 parent c050ba4 commit f065a90

File tree

2 files changed

+0
-67
lines changed

2 files changed

+0
-67
lines changed

crates/bevy_mod_scripting_core/src/docs.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

crates/bevy_mod_scripting_core/src/lib.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use context::{
1313
Context, ContextAssigner, ContextBuilder, ContextInitializer, ContextLoadingSettings,
1414
ContextPreHandlingInitializer, ScriptContexts,
1515
};
16-
use docs::{Documentation, DocumentationFragment};
1716
use event::ScriptCallbackEvent;
1817
use handler::{CallbackSettings, HandlerFn};
1918
use runtime::{initialize_runtime, Runtime, RuntimeContainer, RuntimeInitializer, RuntimeSettings};
@@ -23,7 +22,6 @@ pub mod asset;
2322
pub mod bindings;
2423
pub mod commands;
2524
pub mod context;
26-
pub mod docs;
2725
pub mod error;
2826
pub mod event;
2927
pub mod handler;
@@ -241,44 +239,3 @@ impl AddRuntimeInitializer for App {
241239
self
242240
}
243241
}
244-
245-
pub trait StoreDocumentation<D: DocumentationFragment> {
246-
/// Adds a documentation fragment to the documentation store.
247-
fn add_documentation_fragment(&mut self, fragment: D) -> &mut Self;
248-
/// Consumes all the stored documentation fragments, and merges them into one, then generates the documentation.
249-
fn generate_docs(&mut self) -> Result<(), Box<dyn std::error::Error>>;
250-
}
251-
252-
impl<D: DocumentationFragment> StoreDocumentation<D> for App {
253-
fn add_documentation_fragment(&mut self, fragment: D) -> &mut Self {
254-
self.world_mut()
255-
.init_non_send_resource::<Documentation<D>>();
256-
self.world_mut()
257-
.non_send_resource_mut::<Documentation<D>>()
258-
.as_mut()
259-
.fragments
260-
.push(fragment);
261-
self
262-
}
263-
264-
fn generate_docs(&mut self) -> Result<(), Box<dyn std::error::Error>> {
265-
let mut docs = match self
266-
.world_mut()
267-
.remove_non_send_resource::<Documentation<D>>()
268-
{
269-
Some(docs) => docs,
270-
None => return Ok(()),
271-
};
272-
273-
let mut top_fragment = match docs.fragments.pop() {
274-
Some(fragment) => fragment,
275-
None => return Ok(()),
276-
};
277-
278-
for fragment in docs.fragments.into_iter() {
279-
top_fragment = top_fragment.merge(fragment);
280-
}
281-
282-
top_fragment.gen_docs()
283-
}
284-
}

0 commit comments

Comments
 (0)