aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jake Swenson <jake@jakeswenson.com> 2023-01-02 08:28:24 -0800
committerGravatar Jake Swenson <jake@jakeswenson.com> 2023-01-02 08:28:24 -0800
commita5d01384ef632d03d6040c090529fca7e29d568b (patch)
tree279ebb6a7ea1f53695be0a19752e3c9458bbb892
parent43fd57ab2f7fd0e478001d97be5e66156feaa4cc (diff)
downloadnotion-a5d01384ef632d03d6040c090529fca7e29d568b.tar.gz
notion-a5d01384ef632d03d6040c090529fca7e29d568b.tar.zst
notion-a5d01384ef632d03d6040c090529fca7e29d568b.zip
style(clippy+fmt): Format code and fix clippy issues
-rw-r--r--src/ids.rs2
-rw-r--r--src/lib.rs5
-rw-r--r--src/models/mod.rs2
3 files changed, 6 insertions, 3 deletions
diff --git a/src/ids.rs b/src/ids.rs
index 05dac7e..611212e 100644
--- a/src/ids.rs
+++ b/src/ids.rs
@@ -15,7 +15,7 @@ where
T: Identifier,
{
fn as_id(&self) -> &T {
- &self
+ self
}
}
diff --git a/src/lib.rs b/src/lib.rs
index 46c3358..dca0158 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -180,7 +180,10 @@ impl NotionApi {
}
/// Creates a new page and return the created page
- pub async fn create_page<T: Into<PageCreateRequest>>(&self, page: T) -> Result<Page, Error> {
+ pub async fn create_page<T: Into<PageCreateRequest>>(
+ &self,
+ page: T,
+ ) -> Result<Page, Error> {
let result = self
.make_json_request(
self.client
diff --git a/src/models/mod.rs b/src/models/mod.rs
index 3f83a7d..3c9d12b 100644
--- a/src/models/mod.rs
+++ b/src/models/mod.rs
@@ -173,7 +173,7 @@ impl Properties {
pub fn title(&self) -> Option<String> {
self.properties.values().find_map(|p| match p {
PropertyValue::Title { title, .. } => {
- Some(title.into_iter().map(|t| t.plain_text()).collect())
+ Some(title.iter().map(|t| t.plain_text()).collect())
}
_ => None,
})