MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / normalize_url

Function normalize_url

atomic-cli/src/commands/clone/helpers.rs:654–656  ·  view source on GitHub ↗

Format bytes in a human-readable way. # Arguments `bytes` - The number of bytes # Returns A formatted string like "1.5 KB" or "2.3 MB". # Example ```rust use atomic::commands::clone::helpers::format_bytes; assert_eq!(format_bytes(512), "512 B"); assert_eq!(format_bytes(1536), "1.5 KB"); ``` Normalize a URL by removing trailing slashes. # Arguments `url` - The URL to normalize # Returns

(url: &str)

Source from the content-addressed store, hash-verified

652///
653/// The URL with any trailing slashes removed.
654pub fn normalize_url(url: &str) -> String {
655 url.trim_end_matches('/').to_string()
656}
657
658/// Clean up a directory on error (e.g., failed clone).
659///

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected