Skip to content

Commit

Permalink
Merge pull request #876 from benjamin-747/main
Browse files Browse the repository at this point in the history
fix[mercury]: update outdated doc test.
  • Loading branch information
genedna authored Feb 27, 2025
2 parents e739a77 + 20d7fe6 commit 7c8b65c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ buck-out
**/*.gresource
monobean/resources/lib

# Temporary test cache dir
/tests/.cache_tmp
9 changes: 5 additions & 4 deletions gemini/src/lfs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ use crate::{
/// - `file_size`: file_size
/// - `origin`: origin
///
/// for example
/// ```
/// ## Example
/// Here is an example of the JSON payload:
/// ```json
/// {
/// "bootstrap_node":"https://gitmono.org/relay",
/// "file_hash":"52c90a86cb034b7a1c4beb79304fa76bd0a6cbb7b168c3a935076c714bd1c6b6",
Expand Down Expand Up @@ -70,7 +71,7 @@ pub async fn share_lfs(
/// - `file_hash`: file_hash
///
/// for example
/// ```
/// ```json
/// {
/// "bootstrap_node":"https://gitmono.org/relay",
/// "file_hash":"52c90a86cb034b7a1c4beb79304fa76bd0a6cbb7b168c3a935076c714bd1c6b6",
Expand Down Expand Up @@ -109,7 +110,7 @@ pub async fn get_lfs_chunks_info(bootstrap_node: String, file_hash: String) -> O
/// - `file_uri`: file_uri
///
/// for example
/// ```
/// ```json
/// {
/// "bootstrap_node":"https://gitmono.org/relay",
/// "ztm_agent_port":777,
Expand Down
21 changes: 3 additions & 18 deletions mercury/src/internal/object/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,7 @@ impl Display for TreeItem {
}

impl TreeItem {
/// Create a new TreeItem from a mode, id and name
///
/// # Example
/// ```rust
/// use venus::internal::object::tree::{TreeItem, TreeItemMode};
/// use venus::hash::SHA1;
///
/// // Create an empty TreeItem with the default Hash
/// let default_item = TreeItem::new(TreeItemMode::Blob, SHA1::default(), String::new());
///
/// // Create a blob TreeItem with a custom Hash, and file name
/// let file_item = TreeItem::new(TreeItemMode::Blob, SHA1::new_from_str("1234567890abcdef1234567890abcdef12345678"), String::from("hello.txt"));
///
/// // Create a tree TreeItem with a custom Hash, and directory name
/// let dir_item = TreeItem::new(TreeItemMode::Tree, SHA1::new_from_str("1234567890abcdef1234567890abcdef12345678"), String::from("data"));
/// ```
// Create a new TreeItem from a mode, id and name
pub fn new(mode: TreeItemMode, id: SHA1, name: String) -> Self {
TreeItem { mode, id, name }
}
Expand Down Expand Up @@ -206,8 +191,8 @@ impl TreeItem {
/// Convert a TreeItem to a byte vector
/// ```rust
/// use std::str::FromStr;
/// use venus::internal::object::tree::{TreeItem, TreeItemMode};
/// use venus::hash::SHA1;
/// use mercury::internal::object::tree::{TreeItem, TreeItemMode};
/// use mercury::hash::SHA1;
///
/// let tree_item = TreeItem::new(
/// TreeItemMode::Blob,
Expand Down

1 comment on commit 7c8b65c

@vercel
Copy link

@vercel vercel bot commented on 7c8b65c Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mega – ./

mega-gitmono.vercel.app
mega-git-main-gitmono.vercel.app
gitmega.dev
www.gitmega.dev

Please sign in to comment.