From 512d0255f2939d26484e0978ed1c3f05a5c86a0e Mon Sep 17 00:00:00 2001 From: Quanyi Ma Date: Sun, 2 Jul 2023 10:42:30 +0900 Subject: [PATCH 1/2] Improve the Rustdoc Signed-off-by: Quanyi Ma --- git/src/internal/object/tag.rs | 4 ++-- git/src/internal/object/tree.rs | 6 ++++-- src/main.rs | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/git/src/internal/object/tag.rs b/git/src/internal/object/tag.rs index 7131c51d..c28cb113 100644 --- a/git/src/internal/object/tag.rs +++ b/git/src/internal/object/tag.rs @@ -23,8 +23,8 @@ //! and then move the tag to a different commit, the tag will still point to the original commit. //! //! The lightweight just a text file with the commit hash in it, and the file name is the tag name. -//! If one of -a, -s, or -u is passed, the command creates a tag object, and requires a tag -//! message. Unless -m or -F is given, an editor is started for the user to type in the +//! If one of -a, -s, or -u \ is passed, the command creates a tag object, and requires a tag +//! message. Unless -m \ or -F \ is given, an editor is started for the user to type in the //! tag message. //! //! ```bash diff --git a/git/src/internal/object/tree.rs b/git/src/internal/object/tree.rs index 3c1d5290..47732217 100644 --- a/git/src/internal/object/tree.rs +++ b/git/src/internal/object/tree.rs @@ -182,10 +182,12 @@ impl TreeItem { /// ``` /// /// # Example + /// /// ```rust - // let bytes = Vec::::new().to_bytes(); - // let tree_item = TreeItem::new_from_bytes(bytes.as_slice()).unwrap(); + /// let bytes = Vec::::new().to_bytes(); + /// let tree_item = TreeItem::new_from_bytes(bytes.as_slice()).unwrap(); /// ``` + /// #[allow(unused)] pub fn new_from_bytes(bytes: &[u8]) -> Result { let mut parts = bytes.splitn(2, |b| *b == b' '); diff --git a/src/main.rs b/src/main.rs index 8ed8e2bf..2e362d47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ -//! +//! Mega is an engine for managing a monorepo. It functions similarly to Google's Piper and helps to streamline Git +//! and trunk-based development for large-scale projects. //! //! //! @@ -13,6 +14,7 @@ fn main() { env::set_var("RUST_LOG", "debug"); tracing_subscriber::fmt::init(); dotenvy::dotenv().ok(); + // Parse the command line arguments let result = cli::parse(); From 3ff0fc6d79d508419294d671cfe7fe414e8665df Mon Sep 17 00:00:00 2001 From: Quanyi Ma Date: Sun, 2 Jul 2023 10:47:22 +0900 Subject: [PATCH 2/2] Remove the Rust code in the comments Signed-off-by: Quanyi Ma --- git/src/internal/object/tree.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/git/src/internal/object/tree.rs b/git/src/internal/object/tree.rs index 47732217..31649bda 100644 --- a/git/src/internal/object/tree.rs +++ b/git/src/internal/object/tree.rs @@ -180,13 +180,6 @@ impl TreeItem { /// ```bash /// \0 /// ``` - /// - /// # Example - /// - /// ```rust - /// let bytes = Vec::::new().to_bytes(); - /// let tree_item = TreeItem::new_from_bytes(bytes.as_slice()).unwrap(); - /// ``` /// #[allow(unused)] pub fn new_from_bytes(bytes: &[u8]) -> Result {