From fd7c895094e98a0a940841f8608ddf1a970e2c93 Mon Sep 17 00:00:00 2001 From: Beomjin Kim Date: Wed, 9 Dec 2015 16:08:44 +0900 Subject: [PATCH 1/3] 1. converted the first comments in servo/lib.rs into doc comments. 2. moved doc comment of impl Browser to pub struct Browser. --- components/servo/lib.rs | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 3f21db22c70..d6f94263d59 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -2,20 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -// Servo, the mighty web browser engine from the future. -// -// This is a very simple library that wires all of Servo's components -// together as type `Browser`, along with a generic client -// implementing the `WindowMethods` trait, to create a working web -// browser. -// -// The `Browser` type is responsible for configuring a -// `Constellation`, which does the heavy lifting of coordinating all -// of Servo's internal subsystems, including the `ScriptTask` and the -// `LayoutTask`, as well maintains the navigation context. -// -// The `Browser` is fed events from a generic type that implements the -// `WindowMethods` trait. +/// Servo, the mighty web browser engine from the future. +/// +/// This is a very simple library that wires all of Servo's components +/// together as type `Browser`, along with a generic client +/// implementing the `WindowMethods` trait, to create a working web +/// browser. +/// +/// The `Browser` type is responsible for configuring a +/// `Constellation`, which does the heavy lifting of coordinating all +/// of Servo's internal subsystems, including the `ScriptTask` and the +/// `LayoutTask`, as well maintains the navigation context. +/// +/// The `Browser` is fed events from a generic type that implements the +/// `WindowMethods` trait. extern crate gaol; extern crate libc; @@ -103,10 +103,6 @@ pub use export::script_traits; pub use export::style; pub use export::url; -pub struct Browser { - compositor: Box, -} - /// The in-process interface to Servo. /// /// It does everything necessary to render the web, primarily @@ -118,6 +114,11 @@ pub struct Browser { /// application Servo is embedded in. Clients then create an event /// loop to pump messages between the embedding application and /// various browser components. + +pub struct Browser { + compositor: Box, +} + impl Browser { pub fn new(window: Option>) -> Browser where Window: WindowMethods + 'static { From a2d0e251a0fee8629d442259a022d63b34c9afbf Mon Sep 17 00:00:00 2001 From: Beomjin Kim Date: Wed, 9 Dec 2015 16:17:50 +0900 Subject: [PATCH 2/3] Removed space between doc comment and the actual code of pub struct Browser --- components/servo/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/servo/lib.rs b/components/servo/lib.rs index d6f94263d59..0fd5a324fff 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -114,7 +114,6 @@ pub use export::url; /// application Servo is embedded in. Clients then create an event /// loop to pump messages between the embedding application and /// various browser components. - pub struct Browser { compositor: Box, } From 4d3a6de0291185feb1e116155d18cc29c98864c7 Mon Sep 17 00:00:00 2001 From: Beomjin Kim Date: Wed, 9 Dec 2015 16:23:52 +0900 Subject: [PATCH 3/3] Modified doc command into module-level doc comment. --- components/servo/lib.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 0fd5a324fff..8c0f920554f 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -2,20 +2,20 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/// Servo, the mighty web browser engine from the future. -/// -/// This is a very simple library that wires all of Servo's components -/// together as type `Browser`, along with a generic client -/// implementing the `WindowMethods` trait, to create a working web -/// browser. -/// -/// The `Browser` type is responsible for configuring a -/// `Constellation`, which does the heavy lifting of coordinating all -/// of Servo's internal subsystems, including the `ScriptTask` and the -/// `LayoutTask`, as well maintains the navigation context. -/// -/// The `Browser` is fed events from a generic type that implements the -/// `WindowMethods` trait. +//! Servo, the mighty web browser engine from the future. +//! +//! This is a very simple library that wires all of Servo's components +//! together as type `Browser`, along with a generic client +//! implementing the `WindowMethods` trait, to create a working web +//! browser. +//! +//! The `Browser` type is responsible for configuring a +//! `Constellation`, which does the heavy lifting of coordinating all +//! of Servo's internal subsystems, including the `ScriptTask` and the +//! `LayoutTask`, as well maintains the navigation context. +//! +//! The `Browser` is fed events from a generic type that implements the +//! `WindowMethods` trait. extern crate gaol; extern crate libc;