feat: removed more unneccesary clones
This commit is contained in:
parent
50ccd6b339
commit
1ff6ebc113
1 changed files with 7 additions and 9 deletions
16
src/lib.rs
16
src/lib.rs
|
@ -388,9 +388,7 @@ pub struct Users<'a> {
|
|||
|
||||
impl Users<'_> {
|
||||
pub async fn get(&self) -> Result<QueryResponse<User>> {
|
||||
let url = "https://api.notion.com/v1/users".to_owned();
|
||||
|
||||
let request = self.http_client.get(&url);
|
||||
let request = self.http_client.get("https://api.notion.com/v1/users");
|
||||
|
||||
let mut response = (self.request_handler)(request).await?;
|
||||
|
||||
|
@ -841,7 +839,7 @@ pub enum DatabaseProperty {
|
|||
}
|
||||
|
||||
impl DatabaseProperty {
|
||||
pub fn id(&self) -> Option<String> {
|
||||
pub fn id(&self) -> Option<&str> {
|
||||
use DatabaseProperty::*;
|
||||
|
||||
match self {
|
||||
|
@ -864,13 +862,13 @@ impl DatabaseProperty {
|
|||
| Status { id, .. }
|
||||
| Title { id, .. }
|
||||
| Button { id, .. }
|
||||
| Url { id, .. } => Some(id.to_owned()),
|
||||
| Url { id, .. } => Some(id),
|
||||
|
||||
Unsupported(..) => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn name(&self) -> Option<String> {
|
||||
pub fn name(&self) -> Option<&str> {
|
||||
use DatabaseProperty::*;
|
||||
|
||||
match self {
|
||||
|
@ -893,7 +891,7 @@ impl DatabaseProperty {
|
|||
| Status { name, .. }
|
||||
| Button { name, .. }
|
||||
| Title { name, .. }
|
||||
| Url { name, .. } => Some(name.to_owned()),
|
||||
| Url { name, .. } => Some(name),
|
||||
|
||||
Unsupported(..) => None,
|
||||
}
|
||||
|
@ -1082,7 +1080,7 @@ pub enum Property {
|
|||
}
|
||||
|
||||
impl Property {
|
||||
pub fn id(&self) -> Option<String> {
|
||||
pub fn id(&self) -> Option<&str> {
|
||||
use Property::*;
|
||||
|
||||
match self {
|
||||
|
@ -1108,7 +1106,7 @@ impl Property {
|
|||
| Formula { id, .. }
|
||||
| Verification { id, .. }
|
||||
| Button { id, .. }
|
||||
| UniqueId { id, .. } => Some(id.to_owned()),
|
||||
| UniqueId { id, .. } => Some(id),
|
||||
|
||||
Unsupported(_) => None,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue