1
0
mirror of https://github.com/rust-lang/rustlings.git synced 2024-12-04 10:35:06 +02:00

remove bottom comment instead of top

This commit is contained in:
Tonći Galić 2020-04-08 11:00:11 +02:00 committed by GitHub
parent dab90f7b91
commit 60393999b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,13 +2,13 @@
// Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html // Read more about them at https://doc.rust-lang.org/std/convert/trait.AsRef.html
// and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively. // and https://doc.rust-lang.org/std/convert/trait.AsMut.html, respectively.
// I AM NOT DONE
// Obtain the number of bytes (not characters) in the given argument // Obtain the number of bytes (not characters) in the given argument
// Add the AsRef trait appropriately as a trait bound // Add the AsRef trait appropriately as a trait bound
fn byte_counter<T>(arg: T) -> usize { fn byte_counter<T>(arg: T) -> usize {
arg.as_ref().as_bytes().len() arg.as_ref().as_bytes().len()
} }
// I AM NOT DONE
// Obtain the number of characters (not bytes) in the given argument // Obtain the number of characters (not bytes) in the given argument
// Add the AsRef trait appropriately as a trait bound // Add the AsRef trait appropriately as a trait bound
fn char_counter<T>(arg: T) -> usize { fn char_counter<T>(arg: T) -> usize {