Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let source = String::from("Hello, world!");
- let (result, length) = calculate_length(source);
- println!("'{}' takes {} bytes", result, length);
- }
- fn calculate_length(s: String) -> (String, usize) {
- (s, s.len())
- }
Add Comment
Please, Sign In to add comment