Skip to content

Commit

Permalink
Merge pull request #7 from brainhivenl/feat/make-height-and-width-opt…
Browse files Browse the repository at this point in the history
…ional

feat: make height and width optional
  • Loading branch information
Rick-VA authored Aug 29, 2024
2 parents ac70b6f + f84557f commit d0811ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oembed-rs"
version = "0.0.6"
version = "0.0.7"
edition = "2021"
license = "MIT"
readme = "README.md"
Expand Down
14 changes: 7 additions & 7 deletions src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ pub enum EmbedType {
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Video {
pub html: String,
pub width: i32,
pub height: i32,
pub width: Option<i32>,
pub height: Option<i32>,
}

/// Photo type
Expand All @@ -68,8 +68,8 @@ pub struct Video {
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Photo {
pub url: String,
pub width: i32,
pub height: i32,
pub width: Option<i32>,
pub height: Option<i32>,
}

/// Rich type
Expand All @@ -79,7 +79,7 @@ pub struct Photo {
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
pub struct Rich {
pub html: String,
pub width: i32,
pub width: Option<i32>,
pub height: Option<i32>,
}

Expand Down Expand Up @@ -126,8 +126,8 @@ mod tests {
response.oembed_type,
EmbedType::Photo(Photo {
url: "https://example.com/photo.jpg".to_string(),
width: 100,
height: 50
width: Some(100),
height: Some(50)
})
)
}
Expand Down

0 comments on commit d0811ac

Please sign in to comment.