Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix[mercury]: update outdated doc test. #876

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading