Download crates/forge_domain/src/file_operation.rs from SaylorTwift/forgecode: direct link, hf CLI and curl.
- Browser
- Download file 796 Bytes
-
https://huggingface.co/SaylorTwift/forgecode/resolve/main/crates/forge_domain/src/file_operation.rs
- Command line
-
hf download hf://SaylorTwift/forgecode/crates/forge_domain/src/file_operation.rs
-
curl -L -o file_operation.rs https://huggingface.co/SaylorTwift/forgecode/resolve/main/crates/forge_domain/src/file_operation.rs
796 Bytes
| use derive_setters::Setters; | |
| use serde::{Deserialize, Serialize}; | |
| use crate::ToolKind; | |
| /// Tracks metrics for individual file changes | |
| pub struct FileOperation { | |
| pub lines_added: u64, | |
| pub lines_removed: u64, | |
| /// Content hash of the file. None if file is unreadable (deleted, no | |
| /// permissions, etc.) | |
| pub content_hash: Option<String>, | |
| /// The tool that performed this operation | |
| pub tool: ToolKind, | |
| } | |
| impl FileOperation { | |
| /// Creates a new FileChangeMetrics with the specified tool | |
| /// Other fields default to zero/None and can be set using setters | |
| pub fn new(tool: ToolKind) -> Self { | |
| Self { lines_added: 0, lines_removed: 0, content_hash: None, tool } | |
| } | |
| } | |