thanks clippy
This commit is contained in:
parent
b24daeec6e
commit
34ed0a2168
|
@ -990,7 +990,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mycelial_technology"
|
name = "mycelial_technology"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"log",
|
"log",
|
||||||
"miniserde",
|
"miniserde",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "mycelial_technology"
|
name = "mycelial_technology"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
authors = ["glyph <glyph@mycelial.technology>"]
|
authors = ["glyph <glyph@mycelial.technology>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
extern crate regex;
|
extern crate regex;
|
||||||
extern crate rss;
|
extern crate rss;
|
||||||
|
|
||||||
|
use regex::Regex;
|
||||||
|
use rss::{ChannelBuilder, Item};
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use regex::Regex;
|
|
||||||
use rss::{ChannelBuilder, Item};
|
|
||||||
|
|
||||||
fn main() -> Result<(), Box<dyn error::Error>> {
|
fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
// create rss channel for mycelial.technology
|
// create rss channel for mycelial.technology
|
||||||
|
@ -25,11 +25,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
let plants = "./templates/plants";
|
let plants = "./templates/plants";
|
||||||
|
|
||||||
// add directories to a vector
|
// add directories to a vector
|
||||||
let mut dirs = Vec::new();
|
let dirs = vec![bacteria, computers, fungi, plants];
|
||||||
dirs.push(bacteria);
|
|
||||||
dirs.push(computers);
|
|
||||||
dirs.push(fungi);
|
|
||||||
dirs.push(plants);
|
|
||||||
|
|
||||||
// create vectors for item fields
|
// create vectors for item fields
|
||||||
let mut titles = Vec::new();
|
let mut titles = Vec::new();
|
||||||
|
@ -46,8 +42,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
|
||||||
// populate item url vector from article filenames
|
// populate item url vector from article filenames
|
||||||
let re_url = Regex::new("./templates/(.*).html.tera")?;
|
let re_url = Regex::new("./templates/(.*).html.tera")?;
|
||||||
let caps_url = re_url.captures(
|
let caps_url = re_url.captures(
|
||||||
&path
|
path.to_str()
|
||||||
.to_str()
|
|
||||||
.expect("Failed to convert file path to string slice for regex capture"),
|
.expect("Failed to convert file path to string slice for regex capture"),
|
||||||
);
|
);
|
||||||
if let Some(url) = caps_url {
|
if let Some(url) = caps_url {
|
||||||
|
|
Loading…
Reference in New Issue