From ae414797af228ebb31cbd768236e2274d6b7bcd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Juli=C3=A1n=20Espina?= Date: Wed, 27 Sep 2023 18:23:51 +0000 Subject: [PATCH] Format code snippets in docs (#3317) --- boa_ast/src/statement/switch.rs | 1 - boa_cli/src/main.rs | 1 - boa_engine/src/context/hooks.rs | 13 +- boa_engine/src/context/mod.rs | 3 +- boa_engine/src/error.rs | 6 +- boa_engine/src/job.rs | 5 +- boa_engine/src/lib.rs | 1 - boa_engine/src/module/mod.rs | 10 +- boa_engine/src/object/builtins/jsdataview.rs | 3 +- boa_engine/src/object/builtins/jsdate.rs | 17 +- boa_engine/src/object/builtins/jspromise.rs | 167 +++++++++++++----- boa_engine/src/object/builtins/jsregexp.rs | 1 - boa_engine/src/object/mod.rs | 6 +- boa_engine/src/string/mod.rs | 2 +- boa_engine/src/vm/code_block.rs | 1 - boa_engine/src/vm/opcode/mod.rs | 1 - boa_gc/src/lib.rs | 1 - boa_interner/src/lib.rs | 1 - boa_macros/src/lib.rs | 1 - boa_parser/src/lib.rs | 1 - .../src/parser/cursor/buffered_lexer/tests.rs | 2 +- boa_profiler/src/lib.rs | 1 - boa_runtime/src/lib.rs | 2 - boa_tester/src/main.rs | 1 - boa_wasm/src/lib.rs | 1 - 25 files changed, 162 insertions(+), 87 deletions(-) diff --git a/boa_ast/src/statement/switch.rs b/boa_ast/src/statement/switch.rs index 5543e7af04..87c4154239 100644 --- a/boa_ast/src/statement/switch.rs +++ b/boa_ast/src/statement/switch.rs @@ -1,5 +1,4 @@ //! Switch node. -//! use crate::{ expression::Expression, statement::Statement, diff --git a/boa_cli/src/main.rs b/boa_cli/src/main.rs index 910b42841d..2727eb67aa 100644 --- a/boa_cli/src/main.rs +++ b/boa_cli/src/main.rs @@ -1,5 +1,4 @@ //! A ECMAScript REPL implementation based on boa_engine. -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_engine/src/context/hooks.rs b/boa_engine/src/context/hooks.rs index 182f0d91d6..7d73198ef7 100644 --- a/boa_engine/src/context/hooks.rs +++ b/boa_engine/src/context/hooks.rs @@ -22,10 +22,8 @@ use super::intrinsics::Intrinsics; /// ``` /// use boa_engine::{ /// context::{Context, ContextBuilder, HostHooks}, -/// JsNativeError, -/// JsResult, /// realm::Realm, -/// Source +/// JsNativeError, JsResult, Source, /// }; /// /// struct Hooks; @@ -36,13 +34,18 @@ use super::intrinsics::Intrinsics; /// _realm: Realm, /// context: &mut Context<'_>, /// ) -> JsResult<()> { -/// Err(JsNativeError::typ().with_message("eval calls not available").into()) +/// Err(JsNativeError::typ() +/// .with_message("eval calls not available") +/// .into()) /// } /// } /// let hooks: &dyn HostHooks = &Hooks; // Can have additional state. /// let context = &mut ContextBuilder::new().host_hooks(hooks).build().unwrap(); /// let result = context.eval(Source::from_bytes(r#"eval("let a = 5")"#)); -/// assert_eq!(result.unwrap_err().to_string(), "TypeError: eval calls not available"); +/// assert_eq!( +/// result.unwrap_err().to_string(), +/// "TypeError: eval calls not available" +/// ); /// ``` /// /// [`Host Hooks`]: https://tc39.es/ecma262/#sec-host-hooks-summary diff --git a/boa_engine/src/context/mod.rs b/boa_engine/src/context/mod.rs index f978ab01ea..a8ca9f9483 100644 --- a/boa_engine/src/context/mod.rs +++ b/boa_engine/src/context/mod.rs @@ -50,8 +50,7 @@ use crate::vm::RuntimeLimits; /// use boa_engine::{ /// object::ObjectInitializer, /// property::{Attribute, PropertyDescriptor}, -/// Context, -/// Source +/// Context, Source, /// }; /// /// let script = r#" diff --git a/boa_engine/src/error.rs b/boa_engine/src/error.rs index a3d22cddef..e3f46077bd 100644 --- a/boa_engine/src/error.rs +++ b/boa_engine/src/error.rs @@ -165,7 +165,8 @@ impl JsError { /// ```rust /// # use boa_engine::{Context, JsError, JsNativeError}; /// let context = &mut Context::default(); - /// let error: JsError = JsNativeError::eval().with_message("invalid script").into(); + /// let error: JsError = + /// JsNativeError::eval().with_message("invalid script").into(); /// let error_val = error.to_opaque(context); /// /// assert!(error_val.as_object().unwrap().borrow().is_error()); @@ -345,7 +346,8 @@ impl JsError { /// /// ```rust /// # use boa_engine::{JsError, JsNativeError, JsValue}; - /// let error: JsError = JsNativeError::error().with_message("Unknown error").into(); + /// let error: JsError = + /// JsNativeError::error().with_message("Unknown error").into(); /// /// assert!(error.as_native().is_some()); /// diff --git a/boa_engine/src/job.rs b/boa_engine/src/job.rs index 6411b21d53..a5bbe60653 100644 --- a/boa_engine/src/job.rs +++ b/boa_engine/src/job.rs @@ -253,7 +253,10 @@ pub trait JobQueue { /// can be done by passing a reference to it to the [`ContextBuilder`]: /// /// ``` -/// use boa_engine::{context::ContextBuilder, job::{JobQueue, IdleJobQueue}}; +/// use boa_engine::{ +/// context::ContextBuilder, +/// job::{IdleJobQueue, JobQueue}, +/// }; /// /// let queue: &dyn JobQueue = &IdleJobQueue; /// let context = ContextBuilder::new().job_queue(queue).build(); diff --git a/boa_engine/src/lib.rs b/boa_engine/src/lib.rs index d8c019c30b..809b87f6b2 100644 --- a/boa_engine/src/lib.rs +++ b/boa_engine/src/lib.rs @@ -45,7 +45,6 @@ //! //! [ecma-402]: https://tc39.es/ecma402 //! [examples]: https://github.com/boa-dev/boa/tree/main/boa_examples -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_engine/src/module/mod.rs b/boa_engine/src/module/mod.rs index 026d7ff206..55a0424617 100644 --- a/boa_engine/src/module/mod.rs +++ b/boa_engine/src/module/mod.rs @@ -628,7 +628,10 @@ impl Module { /// # use boa_engine::module::{ModuleLoader, SimpleModuleLoader}; /// let loader = &SimpleModuleLoader::new(Path::new(".")).unwrap(); /// let dyn_loader: &dyn ModuleLoader = loader; - /// let mut context = &mut Context::builder().module_loader(dyn_loader).build().unwrap(); + /// let mut context = &mut Context::builder() + /// .module_loader(dyn_loader) + /// .build() + /// .unwrap(); /// /// let source = Source::from_bytes("1 + 3"); /// @@ -640,7 +643,10 @@ impl Module { /// /// context.run_jobs(); /// - /// assert_eq!(promise.state().unwrap(), PromiseState::Fulfilled(JsValue::undefined())); + /// assert_eq!( + /// promise.state().unwrap(), + /// PromiseState::Fulfilled(JsValue::undefined()) + /// ); /// ``` #[allow(dropping_copy_types)] #[inline] diff --git a/boa_engine/src/object/builtins/jsdataview.rs b/boa_engine/src/object/builtins/jsdataview.rs index fc12a59f09..e665b822b6 100644 --- a/boa_engine/src/object/builtins/jsdataview.rs +++ b/boa_engine/src/object/builtins/jsdataview.rs @@ -27,7 +27,8 @@ use std::ops::Deref; /// let array_buffer = JsArrayBuffer::new(4, context)?; /// /// // Create a new Dataview from pre-existing ArrayBuffer -/// let data_view = JsDataView::from_js_array_buffer(&array_buffer, None, None, context)?; +/// let data_view = +/// JsDataView::from_js_array_buffer(&array_buffer, None, None, context)?; /// /// # Ok(()) /// # } diff --git a/boa_engine/src/object/builtins/jsdate.rs b/boa_engine/src/object/builtins/jsdate.rs index ab23537aa7..3393961a8d 100644 --- a/boa_engine/src/object/builtins/jsdate.rs +++ b/boa_engine/src/object/builtins/jsdate.rs @@ -18,19 +18,22 @@ use crate::{ /// Create a `JsDate` object and set date to December 4 1995 /// /// ``` -/// use boa_engine::{object::builtins::JsDate, Context, JsValue, JsResult}; +/// use boa_engine::{object::builtins::JsDate, Context, JsResult, JsValue}; /// /// fn main() -> JsResult<()> { -/// // JS mutable Context -/// let context = &mut Context::default(); +/// // JS mutable Context +/// let context = &mut Context::default(); /// -/// let date = JsDate::new(context); +/// let date = JsDate::new(context); /// -/// date.set_full_year(&[1995.into(), 11.into(), 4.into()], context)?; +/// date.set_full_year(&[1995.into(), 11.into(), 4.into()], context)?; /// -/// assert_eq!(date.to_date_string(context)?, JsValue::from("Mon Dec 04 1995")); +/// assert_eq!( +/// date.to_date_string(context)?, +/// JsValue::from("Mon Dec 04 1995") +/// ); /// -/// Ok(()) +/// Ok(()) /// } /// ``` #[derive(Debug, Clone, Trace, Finalize)] diff --git a/boa_engine/src/object/builtins/jspromise.rs b/boa_engine/src/object/builtins/jspromise.rs index 5ce0efb53f..b62ae672d9 100644 --- a/boa_engine/src/object/builtins/jspromise.rs +++ b/boa_engine/src/object/builtins/jspromise.rs @@ -40,9 +40,11 @@ use boa_gc::{Finalize, Gc, GcRefCell, Trace}; /// let promise = JsPromise::new( /// |resolvers, context| { /// let result = js_string!("hello world!").into(); -/// resolvers -/// .resolve -/// .call(&JsValue::undefined(), &[result], context)?; +/// resolvers.resolve.call( +/// &JsValue::undefined(), +/// &[result], +/// context, +/// )?; /// Ok(JsValue::undefined()) /// }, /// context, @@ -54,7 +56,10 @@ use boa_gc::{Finalize, Gc, GcRefCell, Trace}; /// FunctionObjectBuilder::new( /// context.realm(), /// NativeFunction::from_fn_ptr(|_, args, _| { -/// Err(JsError::from_opaque(args.get_or_undefined(0).clone()).into()) +/// Err(JsError::from_opaque( +/// args.get_or_undefined(0).clone(), +/// ) +/// .into()) /// }), /// ) /// .build(), @@ -76,10 +81,12 @@ use boa_gc::{Finalize, Gc, GcRefCell, Trace}; /// FunctionObjectBuilder::new( /// context.realm(), /// NativeFunction::from_fn_ptr(|_, _, context| { -/// context -/// .global_object() -/// .clone() -/// .set("finally", JsValue::from(true), true, context)?; +/// context.global_object().clone().set( +/// "finally", +/// JsValue::from(true), +/// true, +/// context, +/// )?; /// Ok(JsValue::undefined()) /// }), /// ) @@ -135,15 +142,25 @@ impl JsPromise { /// # fn main() -> Result<(), Box> { /// let context = &mut Context::default(); /// - /// let promise = JsPromise::new(|resolvers, context| { - /// let result = js_string!("hello world").into(); - /// resolvers.resolve.call(&JsValue::undefined(), &[result], context)?; - /// Ok(JsValue::undefined()) - /// }, context)?; + /// let promise = JsPromise::new( + /// |resolvers, context| { + /// let result = js_string!("hello world").into(); + /// resolvers.resolve.call( + /// &JsValue::undefined(), + /// &[result], + /// context, + /// )?; + /// Ok(JsValue::undefined()) + /// }, + /// context, + /// )?; /// /// context.run_jobs(); /// - /// assert_eq!(promise.state()?, PromiseState::Fulfilled(js_string!("hello world").into())); + /// assert_eq!( + /// promise.state()?, + /// PromiseState::Fulfilled(js_string!("hello world").into()) + /// ); /// # Ok(()) /// # } /// ``` @@ -192,7 +209,9 @@ impl JsPromise { /// /// assert_eq!(promise.state()?, PromiseState::Pending); /// - /// resolvers.reject.call(&JsValue::undefined(), &[5.into()], context)?; + /// resolvers + /// .reject + /// .call(&JsValue::undefined(), &[5.into()], context)?; /// /// assert_eq!(promise.state()?, PromiseState::Rejected(5.into())); /// @@ -228,12 +247,17 @@ impl JsPromise { /// # fn main() -> Result<(), Box> { /// let context = &mut Context::default(); /// - /// let promise = context.eval(Source::from_bytes("new Promise((resolve, reject) => resolve())"))?; + /// let promise = context.eval(Source::from_bytes( + /// "new Promise((resolve, reject) => resolve())", + /// ))?; /// let promise = promise.as_object().cloned().unwrap(); /// /// let promise = JsPromise::from_object(promise)?; /// - /// assert_eq!(promise.state()?, PromiseState::Fulfilled(JsValue::undefined())); + /// assert_eq!( + /// promise.state()?, + /// PromiseState::Fulfilled(JsValue::undefined()) + /// ); /// /// assert!(JsPromise::from_object(JsObject::with_null_proto()).is_err()); /// @@ -327,7 +351,10 @@ impl JsPromise { /// /// let promise = JsPromise::resolve(js_string!("resolved!"), context)?; /// - /// assert_eq!(promise.state()?, PromiseState::Fulfilled(js_string!("resolved!").into())); + /// assert_eq!( + /// promise.state()?, + /// PromiseState::Fulfilled(js_string!("resolved!").into()) + /// ); /// /// # Ok(()) /// # } @@ -363,9 +390,15 @@ impl JsPromise { /// # fn main() -> Result<(), Box> { /// let context = &mut Context::default(); /// - /// let promise = JsPromise::reject(JsError::from_opaque(js_string!("oops!").into()), context)?; + /// let promise = JsPromise::reject( + /// JsError::from_opaque(js_string!("oops!").into()), + /// context, + /// )?; /// - /// assert_eq!(promise.state()?, PromiseState::Rejected(js_string!("oops!").into())); + /// assert_eq!( + /// promise.state()?, + /// PromiseState::Rejected(js_string!("oops!").into()) + /// ); /// /// # Ok(()) /// # } @@ -454,18 +487,23 @@ impl JsPromise { /// /// let promise = JsPromise::new( /// |resolvers, context| { - /// resolvers - /// .resolve - /// .call(&JsValue::undefined(), &[255.255.into()], context)?; + /// resolvers.resolve.call( + /// &JsValue::undefined(), + /// &[255.255.into()], + /// context, + /// )?; /// Ok(JsValue::undefined()) /// }, /// context, - /// )?.then( + /// )? + /// .then( /// Some( /// FunctionObjectBuilder::new( /// context.realm(), /// NativeFunction::from_fn_ptr(|_, args, context| { - /// args.get_or_undefined(0).to_string(context).map(JsValue::from) + /// args.get_or_undefined(0) + /// .to_string(context) + /// .map(JsValue::from) /// }), /// ) /// .build(), @@ -521,17 +559,22 @@ impl JsPromise { /// |resolvers, context| { /// let error = JsNativeError::typ().with_message("thrown"); /// let error = error.to_opaque(context); - /// resolvers - /// .reject - /// .call(&JsValue::undefined(), &[error.into()], context)?; + /// resolvers.reject.call( + /// &JsValue::undefined(), + /// &[error.into()], + /// context, + /// )?; /// Ok(JsValue::undefined()) /// }, /// context, - /// )?.catch( + /// )? + /// .catch( /// FunctionObjectBuilder::new( /// context.realm(), /// NativeFunction::from_fn_ptr(|_, args, context| { - /// args.get_or_undefined(0).to_string(context).map(JsValue::from) + /// args.get_or_undefined(0) + /// .to_string(context) + /// .map(JsValue::from) /// }), /// ) /// .build(), @@ -585,20 +628,25 @@ impl JsPromise { /// |resolvers, context| { /// let error = JsNativeError::typ().with_message("thrown"); /// let error = error.to_opaque(context); - /// resolvers - /// .reject - /// .call(&JsValue::undefined(), &[error.into()], context)?; + /// resolvers.reject.call( + /// &JsValue::undefined(), + /// &[error.into()], + /// context, + /// )?; /// Ok(JsValue::undefined()) /// }, /// context, - /// )?.finally( + /// )? + /// .finally( /// FunctionObjectBuilder::new( /// context.realm(), /// NativeFunction::from_fn_ptr(|_, _, context| { - /// context - /// .global_object() - /// .clone() - /// .set("finally", JsValue::from(true), true, context)?; + /// context.global_object().clone().set( + /// "finally", + /// JsValue::from(true), + /// true, + /// context, + /// )?; /// Ok(JsValue::undefined()) /// }), /// ) @@ -663,7 +711,12 @@ impl JsPromise { /// /// context.run_jobs(); /// - /// let array = promise1.state()?.as_fulfilled().and_then(JsValue::as_object).unwrap().clone(); + /// let array = promise1 + /// .state()? + /// .as_fulfilled() + /// .and_then(JsValue::as_object) + /// .unwrap() + /// .clone(); /// let array = JsArray::from_object(array)?; /// assert_eq!(array.at(0, context)?, 0.into()); /// assert_eq!(array.at(1, context)?, 2.into()); @@ -726,7 +779,12 @@ impl JsPromise { /// /// context.run_jobs(); /// - /// let array = promise.state()?.as_fulfilled().and_then(JsValue::as_object).unwrap().clone(); + /// let array = promise + /// .state()? + /// .as_fulfilled() + /// .and_then(JsValue::as_object) + /// .unwrap() + /// .clone(); /// let array = JsArray::from_object(array)?; /// /// let a = array.at(0, context)?.as_object().unwrap().clone(); @@ -735,7 +793,10 @@ impl JsPromise { /// /// let b = array.at(1, context)?.as_object().unwrap().clone(); /// assert_eq!(b.get("status", context)?, js_string!("rejected").into()); - /// assert_eq!(b.get("reason", context)?.to_string(context)?, js_string!("TypeError")); + /// assert_eq!( + /// b.get("reason", context)?.to_string(context)?, + /// js_string!("TypeError") + /// ); /// /// let c = array.at(2, context)?.as_object().unwrap().clone(); /// assert_eq!(c.get("status", context)?, js_string!("fulfilled").into()); @@ -788,7 +849,6 @@ impl JsPromise { /// # fn main() -> Result<(), Box> { /// let context = &mut Context::default(); /// - /// /// let promise = JsPromise::any( /// [ /// JsPromise::reject(JsNativeError::syntax(), context)?, @@ -801,7 +861,10 @@ impl JsPromise { /// /// context.run_jobs(); /// - /// assert_eq!(promise.state()?, PromiseState::Fulfilled(js_string!("fulfilled").into())); + /// assert_eq!( + /// promise.state()?, + /// PromiseState::Fulfilled(js_string!("fulfilled").into()) + /// ); /// /// # Ok(()) /// # } @@ -856,8 +919,14 @@ impl JsPromise { /// let promise = JsPromise::race([a, b, c], context)?; /// /// resolvers_b.reject.call(&JsValue::undefined(), &[], context); - /// resolvers_a.resolve.call(&JsValue::undefined(), &[5.into()], context); - /// resolvers_c.reject.call(&JsValue::undefined(), &[js_string!("c error").into()], context); + /// resolvers_a + /// .resolve + /// .call(&JsValue::undefined(), &[5.into()], context); + /// resolvers_c.reject.call( + /// &JsValue::undefined(), + /// &[js_string!("c error").into()], + /// context, + /// ); /// /// context.run_jobs(); /// @@ -913,12 +982,12 @@ impl JsPromise { /// let (promise, resolvers) = JsPromise::new_pending(context); /// let promise_future = promise.into_js_future(context)?; /// - /// let future1 = async move { - /// promise_future.await - /// }; + /// let future1 = async move { promise_future.await }; /// /// let future2 = async move { - /// resolvers.resolve.call(&JsValue::undefined(), &[10.into()], context)?; + /// resolvers + /// .resolve + /// .call(&JsValue::undefined(), &[10.into()], context)?; /// context.run_jobs(); /// Ok::<(), JsError>(()) /// }; diff --git a/boa_engine/src/object/builtins/jsregexp.rs b/boa_engine/src/object/builtins/jsregexp.rs index 73b808e26e..86e3969708 100644 --- a/boa_engine/src/object/builtins/jsregexp.rs +++ b/boa_engine/src/object/builtins/jsregexp.rs @@ -35,7 +35,6 @@ use std::ops::Deref; /// # Ok(()) /// # } /// ``` -/// #[derive(Debug, Clone, Trace, Finalize)] pub struct JsRegExp { inner: JsObject, diff --git a/boa_engine/src/object/mod.rs b/boa_engine/src/object/mod.rs index e264ac341d..6c1f71d4b6 100644 --- a/boa_engine/src/object/mod.rs +++ b/boa_engine/src/object/mod.rs @@ -2152,7 +2152,11 @@ impl<'realm> FunctionObjectBuilder<'realm> { /// let object = ObjectInitializer::new(&mut context) /// .property("hello", "world", Attribute::all()) /// .property(1, 1, Attribute::all()) -/// .function(NativeFunction::from_fn_ptr(|_, _, _| Ok(JsValue::undefined())), "func", 0) +/// .function( +/// NativeFunction::from_fn_ptr(|_, _, _| Ok(JsValue::undefined())), +/// "func", +/// 0, +/// ) /// .build(); /// ``` /// diff --git a/boa_engine/src/string/mod.rs b/boa_engine/src/string/mod.rs index 2938c9b24b..7089f5457a 100644 --- a/boa_engine/src/string/mod.rs +++ b/boa_engine/src/string/mod.rs @@ -89,7 +89,7 @@ fn alloc_overflow() -> ! { /// ``` /// # use boa_engine::js_string; /// # use boa_engine::string::utf16; -/// const NAME: &[u16] = utf16!("human! "); +/// const NAME: &[u16] = utf16!("human! "); /// let greeting = js_string!("Hello, "); /// let msg = js_string!(&greeting, &NAME, utf16!("Nice to meet you!")); /// diff --git a/boa_engine/src/vm/code_block.rs b/boa_engine/src/vm/code_block.rs index f4ca2fb62e..a08ab7a1c6 100644 --- a/boa_engine/src/vm/code_block.rs +++ b/boa_engine/src/vm/code_block.rs @@ -155,7 +155,6 @@ pub struct CodeBlock { pub(crate) handlers: ThinVec, /// Compile time environments in this function. - /// // Safety: Nothing in CompileTimeEnvironment needs tracing, so this is safe. // // TODO(#3034): Maybe changing this to Gc after garbage collection would be better than Rc. diff --git a/boa_engine/src/vm/opcode/mod.rs b/boa_engine/src/vm/opcode/mod.rs index b4bacd3490..177e1d20d2 100644 --- a/boa_engine/src/vm/opcode/mod.rs +++ b/boa_engine/src/vm/opcode/mod.rs @@ -438,7 +438,6 @@ macro_rules! generate_opcodes { /// /// This trait should be implemented for a struct that corresponds with /// any arm of the `OpCode` enum. -/// pub(crate) trait Operation { const NAME: &'static str; const INSTRUCTION: &'static str; diff --git a/boa_gc/src/lib.rs b/boa_gc/src/lib.rs index 0c7b974c53..acbe0a0e02 100644 --- a/boa_gc/src/lib.rs +++ b/boa_gc/src/lib.rs @@ -3,7 +3,6 @@ //! # Crate Overview //! **`boa_gc`** is a mark-sweep garbage collector that implements a [`Trace`] and [`Finalize`] trait //! for garbage collected values. -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_interner/src/lib.rs b/boa_interner/src/lib.rs index fc2c24bbe1..4475823f25 100644 --- a/boa_interner/src/lib.rs +++ b/boa_interner/src/lib.rs @@ -9,7 +9,6 @@ //! to `usize`, and also it's easier to store, since instead of a heap-allocated string, you only //! need to store a `usize`. This reduces memory consumption and improves performance in the //! compiler. -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_macros/src/lib.rs b/boa_macros/src/lib.rs index 798a6d6415..3727e9ee6b 100644 --- a/boa_macros/src/lib.rs +++ b/boa_macros/src/lib.rs @@ -1,5 +1,4 @@ //! Macros for the Boa JavaScript engine. -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_parser/src/lib.rs b/boa_parser/src/lib.rs index deb6289660..ff2e35e978 100644 --- a/boa_parser/src/lib.rs +++ b/boa_parser/src/lib.rs @@ -9,7 +9,6 @@ //! [spec]: https://tc39.es/ecma262 //! [lex]: https://tc39.es/ecma262/#sec-ecmascript-language-lexical-grammar //! [grammar]: https://tc39.es/ecma262/#sec-ecmascript-language-expressions -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_parser/src/parser/cursor/buffered_lexer/tests.rs b/boa_parser/src/parser/cursor/buffered_lexer/tests.rs index 3f84a09167..923d206bc6 100644 --- a/boa_parser/src/parser/cursor/buffered_lexer/tests.rs +++ b/boa_parser/src/parser/cursor/buffered_lexer/tests.rs @@ -266,7 +266,7 @@ fn skip_peeked_terminators() { .unwrap() .expect("Some value expected") .kind(), - TokenKind::identifier(interner.get_or_intern_static("B", utf16!("B"))) // This value is after the line terminator + TokenKind::identifier(interner.get_or_intern_static("B", utf16!("B"))) /* This value is after the line terminator */ ); assert_eq!( diff --git a/boa_profiler/src/lib.rs b/boa_profiler/src/lib.rs index 2a9639502d..801465953b 100644 --- a/boa_profiler/src/lib.rs +++ b/boa_profiler/src/lib.rs @@ -6,7 +6,6 @@ //! see Boa's page on [profiling][profiler-md]. //! //! [profiler-md]: https://github.com/boa-dev/boa/blob/main/docs/profiling.md -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_runtime/src/lib.rs b/boa_runtime/src/lib.rs index aa37a19bd0..bf14637994 100644 --- a/boa_runtime/src/lib.rs +++ b/boa_runtime/src/lib.rs @@ -37,9 +37,7 @@ //! # panic!("An error occured in boa_runtime's js_code"); //! } //! }; -//! //! ``` -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_tester/src/main.rs b/boa_tester/src/main.rs index 2481267c19..66ad305f11 100644 --- a/boa_tester/src/main.rs +++ b/boa_tester/src/main.rs @@ -2,7 +2,6 @@ //! //! This crate will run the full ECMAScript test suite (Test262) and report compliance of the //! `boa` engine. -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg", diff --git a/boa_wasm/src/lib.rs b/boa_wasm/src/lib.rs index f1fc6eea52..f296fcebdc 100644 --- a/boa_wasm/src/lib.rs +++ b/boa_wasm/src/lib.rs @@ -1,5 +1,4 @@ //! An ECMAScript WASM implementation based on boa_engine. -//! #![doc = include_str!("../ABOUT.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/boa-dev/boa/main/assets/logo.svg",