summaryrefslogtreecommitdiff
path: root/exercises/conversions
diff options
context:
space:
mode:
authorEmmanuel Roullit <eroullit@github.com>2023-02-25 17:11:43 +0100
committerGitHub <noreply@github.com>2023-02-25 17:11:43 +0100
commitfcadbfc70d578e4a993711d5a7f1737aebd6b3ce (patch)
tree897142c1904755a43aefce56695c0b8186381e69 /exercises/conversions
parentb653d4848a52701d2240f130ab74c158dd5d7069 (diff)
parent701b4bef51b50d1fd3bb7fbfe3cc274f2bbdcb0c (diff)
Merge branch 'rust-lang:main' into codespaces
Diffstat (limited to 'exercises/conversions')
-rw-r--r--exercises/conversions/as_ref_mut.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/exercises/conversions/as_ref_mut.rs b/exercises/conversions/as_ref_mut.rs
index c9eed7d..e6a9d11 100644
--- a/exercises/conversions/as_ref_mut.rs
+++ b/exercises/conversions/as_ref_mut.rs
@@ -5,21 +5,22 @@
// I AM NOT DONE
-// Obtain the number of bytes (not characters) in the given argument
-// Add the AsRef trait appropriately as a trait bound
+// Obtain the number of bytes (not characters) in the given argument.
+// TODO: Add the AsRef trait appropriately as a trait bound.
fn byte_counter<T>(arg: T) -> usize {
arg.as_ref().as_bytes().len()
}
-// Obtain the number of characters (not bytes) in the given argument
-// Add the AsRef trait appropriately as a trait bound
+// Obtain the number of characters (not bytes) in the given argument.
+// TODO: Add the AsRef trait appropriately as a trait bound.
fn char_counter<T>(arg: T) -> usize {
arg.as_ref().chars().count()
}
-// Squares a number using as_mut(). Add the trait bound as is appropriate and
-// implement the function body.
+// Squares a number using as_mut().
+// TODO: Add the appropriate trait bound.
fn num_sq<T>(arg: &mut T) {
+ // TODO: Implement the function body.
???
}