Browse Source

Update 'src/shared.rs'

Updated comments from issue #3
David Thielemann 1 month ago
parent
commit
1e742bebc3
1 changed files with 2 additions and 3 deletions
  1. 2 3
      src/shared.rs

+ 2 - 3
src/shared.rs

@@ -31,6 +31,7 @@ impl<T> Shared<T> {
     ///
     /// // #[derive(Clone)]
     /// // Clone is no longer needed as of v0.2.0
+    /// #[derive(Debug)]
     /// struct Person {
     ///     pub name: String,
     ///     pub age: u16
@@ -42,8 +43,6 @@ impl<T> Shared<T> {
     ///         name: "Test Dummy".to_string(),
     ///         age: 30
     ///     });
-    ///
-    ///     // See Shared::lock for using it
     /// }
     /// ```
     pub fn new(data: T) -> Self {
@@ -70,7 +69,7 @@ impl<T> Shared<T> {
     ///
     /// { // Direct access
     ///     let person = shared_data.lock().await;
-    ///     println!("Person{{name: {}, age: {}}}", person.name, person.age);
+    ///     println!("{:?}", person);
     /// }
     ///
     /// // Using it as a parameter