Skip to content

Commit

Permalink
fix[mercury]: update outdated doc test.
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-747 committed Feb 27, 2025
1 parent e739a77 commit 20d7fe6
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

0 comments on commit 20d7fe6

Please sign in to comment.