Bump all the deps and appease Clippy, 2022 edition.

This commit is contained in:
Bodil Stokke 2022-01-27 19:34:04 +00:00
parent 95764776f2
commit e18d328951
9 changed files with 40 additions and 45 deletions

View File

@ -5,7 +5,7 @@ name = "dodrio-todomvc"
version = "0.1.0" version = "0.1.0"
[dependencies] [dependencies]
cfg-if = "0.1.7" cfg-if = "1"
dodrio = "0.2.0" dodrio = "0.2.0"
futures = "0.3" futures = "0.3"
js-sys = "0.3.15" js-sys = "0.3.15"

View File

@ -2,6 +2,7 @@
#![recursion_limit = "1024"] #![recursion_limit = "1024"]
#![deny(missing_docs)] #![deny(missing_docs)]
#![allow(unused_braces)]
pub mod controller; pub mod controller;
pub mod keys; pub mod keys;

View File

@ -16,13 +16,13 @@ keywords = ["jsx", "html", "wasm"]
proc-macro = true proc-macro = true
[dependencies] [dependencies]
lalrpop-util = "0.18" lalrpop-util = "0.19"
ansi_term = "0.12.0" ansi_term = "0.12.0"
proc-macro2 = { version = "1.0.4", features = ["nightly"] } proc-macro2 = { version = "1.0.4", features = ["nightly"] }
quote = "1.0.2" quote = "1.0.2"
[build-dependencies] [build-dependencies]
lalrpop = "0.18" lalrpop = "0.19"
version_check = "0.9.1" version_check = "0.9.1"
[features] [features]

View File

@ -35,7 +35,7 @@ impl Declare {
fn attr_type_name(&self) -> TokenTree { fn attr_type_name(&self) -> TokenTree {
Ident::new( Ident::new(
&format!("Attrs_{}", self.name.to_string()), &format!("Attrs_{}", self.name),
self.name.span(), self.name.span(),
) )
.into() .into()
@ -53,7 +53,7 @@ impl Declare {
fn req_children(&self) -> impl Iterator<Item = (TokenTree, TokenTree, TokenTree)> + '_ { fn req_children(&self) -> impl Iterator<Item = (TokenTree, TokenTree, TokenTree)> + '_ {
self.req_children.iter().map(|child| { self.req_children.iter().map(|child| {
let child_name: TokenTree = let child_name: TokenTree =
Ident::new(&format!("child_{}", child.to_string()), child.span()).into(); Ident::new(&format!("child_{}", child), child.span()).into();
let child_type: TokenTree = Ident::new(&child.to_string(), child.span()).into(); let child_type: TokenTree = Ident::new(&child.to_string(), child.span()).into();
let child_str = Literal::string(&child.to_string()).into(); let child_str = Literal::string(&child.to_string()).into();
(child_name, child_type, child_str) (child_name, child_type, child_str)

View File

@ -100,10 +100,9 @@ fn extract_data_attrs(attrs: &mut StringyMap<Ident, TokenTree>) -> StringyMap<St
let keys: Vec<Ident> = attrs.keys().cloned().collect(); let keys: Vec<Ident> = attrs.keys().cloned().collect();
for key in keys { for key in keys {
let key_name = key.to_string(); let key_name = key.to_string();
let prefix = "data_"; if let Some(key_name) = key_name.strip_prefix("data_") {
if key_name.starts_with(prefix) {
let value = attrs.remove(&key).unwrap(); let value = attrs.remove(&key).unwrap();
data.insert(key_name[prefix.len()..].to_string(), value); data.insert(key_name.to_string(), value);
} }
} }
data data
@ -116,9 +115,7 @@ fn extract_event_handlers(
let keys: Vec<Ident> = attrs.keys().cloned().collect(); let keys: Vec<Ident> = attrs.keys().cloned().collect();
for key in keys { for key in keys {
let key_name = key.to_string(); let key_name = key.to_string();
let prefix = "on"; if let Some(event_name) = key_name.strip_prefix("on") {
if key_name.starts_with(prefix) {
let event_name = &key_name[prefix.len()..];
let value = attrs.remove(&key).unwrap(); let value = attrs.remove(&key).unwrap();
events.insert(ident::new_raw(event_name, key.span()), value); events.insert(ident::new_raw(event_name, key.span()), value);
} }
@ -148,8 +145,8 @@ fn is_string_literal(literal: &Literal) -> bool {
#[allow(dead_code)] #[allow(dead_code)]
fn stringify_ident(ident: &Ident) -> String { fn stringify_ident(ident: &Ident) -> String {
let s = ident.to_string(); let s = ident.to_string();
if s.starts_with("r#") { if let Some(raw_s) = s.strip_prefix("r#") {
s[2..].to_string() raw_s.to_string()
} else { } else {
s s
} }

View File

@ -30,10 +30,7 @@ impl Token {
} }
pub fn is_ident(&self) -> bool { pub fn is_ident(&self) -> bool {
match self { matches!(self, Token::Ident(_))
Token::Ident(_) => true,
_ => false,
}
} }
} }

View File

@ -19,11 +19,11 @@ maintenance = { status = "looking-for-maintainer" }
all-features = true all-features = true
[dependencies] [dependencies]
typed-html-macros = "0.2.2" typed-html-macros = { path = "../macros" }
strum = "0.18" strum = "0.23"
strum_macros = "0.18" strum_macros = "0.23"
mime = "0.3.13" mime = "0.3.13"
language-tags = "0.2.2" language-tags = "0.3"
htmlescape = "0.3.1" htmlescape = "0.3.1"
proc-macro-nested = "0.1.3" proc-macro-nested = "0.1.3"
stdweb = { version = "0.4.14", optional = true } stdweb = { version = "0.4.14", optional = true }

View File

@ -28,7 +28,7 @@ pub type Integrity = String;
pub type Nonce = String; pub type Nonce = String;
pub type Target = String; pub type Target = String;
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum AreaShape { pub enum AreaShape {
#[strum(to_string = "rect")] #[strum(to_string = "rect")]
Rectangle, Rectangle,
@ -40,7 +40,7 @@ pub enum AreaShape {
Default, Default,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum BoolOrDefault { pub enum BoolOrDefault {
#[strum(to_string = "true")] #[strum(to_string = "true")]
True, True,
@ -50,7 +50,7 @@ pub enum BoolOrDefault {
False, False,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum ButtonType { pub enum ButtonType {
#[strum(to_string = "submit")] #[strum(to_string = "submit")]
Submit, Submit,
@ -60,7 +60,7 @@ pub enum ButtonType {
Button, Button,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum Bool { pub enum Bool {
#[strum(to_string = "true")] #[strum(to_string = "true")]
True, True,
@ -78,7 +78,7 @@ impl From<bool> for Bool {
} }
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum CrossOrigin { pub enum CrossOrigin {
#[strum(to_string = "anonymous")] #[strum(to_string = "anonymous")]
Anonymous, Anonymous,
@ -86,7 +86,7 @@ pub enum CrossOrigin {
UseCredentials, UseCredentials,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum FormEncodingType { pub enum FormEncodingType {
#[strum(to_string = "application/x-www-form-urlencoded")] #[strum(to_string = "application/x-www-form-urlencoded")]
UrlEncoded, UrlEncoded,
@ -96,7 +96,7 @@ pub enum FormEncodingType {
Text, Text,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum FormMethod { pub enum FormMethod {
#[strum(to_string = "post")] #[strum(to_string = "post")]
Post, Post,
@ -104,7 +104,7 @@ pub enum FormMethod {
Get, Get,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum FormDialogMethod { pub enum FormDialogMethod {
#[strum(to_string = "post")] #[strum(to_string = "post")]
Post, Post,
@ -114,7 +114,7 @@ pub enum FormDialogMethod {
Dialog, Dialog,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum HTTPEquiv { pub enum HTTPEquiv {
#[strum(to_string = "content-security-policy")] #[strum(to_string = "content-security-policy")]
ContentSecurityPolicy, ContentSecurityPolicy,
@ -122,7 +122,7 @@ pub enum HTTPEquiv {
Refresh, Refresh,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum ImageDecoding { pub enum ImageDecoding {
#[strum(to_string = "sync")] #[strum(to_string = "sync")]
Sync, Sync,
@ -132,7 +132,7 @@ pub enum ImageDecoding {
Auto, Auto,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum InputType { pub enum InputType {
#[strum(to_string = "button")] #[strum(to_string = "button")]
Button, Button,
@ -180,7 +180,7 @@ pub enum InputType {
Week, Week,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum LinkType { pub enum LinkType {
#[strum(to_string = "alternate")] #[strum(to_string = "alternate")]
Alternate, Alternate,
@ -228,7 +228,7 @@ pub enum LinkType {
Tag, Tag,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum Metadata { pub enum Metadata {
#[strum(to_string = "application-name")] #[strum(to_string = "application-name")]
ApplicationName, ApplicationName,
@ -254,7 +254,7 @@ pub enum Metadata {
Viewport, Viewport,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum OnOff { pub enum OnOff {
#[strum(to_string = "on")] #[strum(to_string = "on")]
On, On,
@ -262,7 +262,7 @@ pub enum OnOff {
Off, Off,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum OrderedListType { pub enum OrderedListType {
#[strum(to_string = "a")] #[strum(to_string = "a")]
LowerCaseLetters, LowerCaseLetters,
@ -276,7 +276,7 @@ pub enum OrderedListType {
Numbers, Numbers,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum Preload { pub enum Preload {
#[strum(to_string = "none")] #[strum(to_string = "none")]
None, None,
@ -286,7 +286,7 @@ pub enum Preload {
Auto, Auto,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum ReferrerPolicy { pub enum ReferrerPolicy {
#[strum(to_string = "no-referrer")] #[strum(to_string = "no-referrer")]
NoReferrer, NoReferrer,
@ -300,7 +300,7 @@ pub enum ReferrerPolicy {
UnsafeUrl, UnsafeUrl,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum Role { pub enum Role {
#[strum(to_string = "any")] #[strum(to_string = "any")]
Any, Any,
@ -440,7 +440,7 @@ pub enum Role {
TreeGrid, TreeGrid,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum Sandbox { pub enum Sandbox {
#[strum(to_string = "allow-forms")] #[strum(to_string = "allow-forms")]
AllowForms, AllowForms,
@ -466,7 +466,7 @@ pub enum Sandbox {
AllowTopNavigationByUserNavigation, AllowTopNavigationByUserNavigation,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum TableHeaderScope { pub enum TableHeaderScope {
#[strum(to_string = "row")] #[strum(to_string = "row")]
Row, Row,
@ -480,7 +480,7 @@ pub enum TableHeaderScope {
Auto, Auto,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum TextDirection { pub enum TextDirection {
#[strum(to_string = "ltr")] #[strum(to_string = "ltr")]
LeftToRight, LeftToRight,
@ -488,7 +488,7 @@ pub enum TextDirection {
RightToLeft, RightToLeft,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum VideoKind { pub enum VideoKind {
#[strum(to_string = "subtitles")] #[strum(to_string = "subtitles")]
Subtitles, Subtitles,
@ -502,7 +502,7 @@ pub enum VideoKind {
Metadata, Metadata,
} }
#[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, AsStaticStr)] #[derive(EnumString, Display, PartialEq, Eq, PartialOrd, Ord, AsRefStr, IntoStaticStr)]
pub enum Wrap { pub enum Wrap {
#[strum(to_string = "hard")] #[strum(to_string = "hard")]
Hard, Hard,

View File

@ -10,7 +10,7 @@ name = "typed-html-tests"
path = "main.rs" path = "main.rs"
[dev-dependencies] [dev-dependencies]
compiletest_rs = { version = "0.5", features = ["stable"] } compiletest_rs = { version = "0.7", features = ["stable"] }
typed-html = { path = "../typed-html" } typed-html = { path = "../typed-html" }
typed-html-macros = { path = "../macros" } typed-html-macros = { path = "../macros" }
version_check = "0.9.1" version_check = "0.9.1"