Skip to content

Commit

Permalink
Create Image::to_base64
Browse files Browse the repository at this point in the history
  • Loading branch information
boswelja committed Dec 1, 2024
1 parent 56d7ec2 commit c507c78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/generation/images.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ use serde::{Deserialize, Serialize};
pub struct Image(String);

impl Image {
pub fn from_base64(base64: &str) -> Self {
pub fn from_base64(base64: impl Into<String>) -> Self {
Self(base64.to_string())

Check failure on line 8 in src/generation/images.rs

View workflow job for this annotation

GitHub Actions / Formatting

no method named `to_string` found for type parameter `impl Into<String>` in the current scope

Check failure on line 8 in src/generation/images.rs

View workflow job for this annotation

GitHub Actions / Build

no method named `to_string` found for type parameter `impl Into<String>` in the current scope
}

pub fn to_base64(&self) -> &str {
&self.0
}
}

0 comments on commit c507c78

Please sign in to comment.