Skip to content

Commit

Permalink
refactor: add 'is_url' use in monset.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kremilly committed Sep 12, 2024
1 parent d851e28 commit eacf2e2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cmd/monset.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use reqwest;
use is_url::is_url;

use std::{
fs::File,
error::Error,

io::{
Read,
Cursor
Expand All @@ -29,7 +30,7 @@ impl Monset {
async fn read_file(run: &str) -> Result<Cursor<Vec<u8>>, Box<dyn Error>> {
let mut buffer = Vec::new();

if run.starts_with("http://") || run.starts_with("https://") {
if is_url(run) {
let response = reqwest::get(run).await?;

if !response.status().is_success() {
Expand Down

0 comments on commit eacf2e2

Please sign in to comment.