HTML custom input with type hidden and number1 min read

I don’t think it is possible to a create an element like

Solution is to create a custom element like this

MDN – Using Custom ELements (https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)

To add a property of value to our <hidden-num> element, we must add the get value()  and set value(val)  methods.

An attribute of value is also added to element if the value property is changed. A number  value is returned if the elem.value  is accessed.

Custom element is registered with

customElements.define("hidden-num", InputHiddenNum);

Built in element can also be extended like

<input is="hidden-num" />

Refer – MDN – Customized built-in Elements (https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#Customized_built-in_elements)

RUST: non-exhaustive patterns: `&_` not covered pattern `&_` not covered21 sec read

Tried something like this

Error

non-exhaustive patterns: &_ not covered pattern &_ not covered

What I thought was wrong

I thought it meant you cannot match references

What the real error was

Just had to add all possibilities in match statement

 

Rust Actix web panic when using custom regex1 min read

Using Actix-web v0.7.4

Error – thread ‘arbiter:6461f87e-20ed-4848-9feb-dbe68ab5ea7e:actor’ panicked at ‘index out of bounds: the len is 1 but the index is 1’, /checkout/src/libcore/slice/mod.rs:2079:10

How I corrected it

The loop was accessing an index which didn’t exist. I don’t really know how actix web works or even how Rust works.

pub fn match_with_params  in router.rs in actix-web src was the culprit

So I changed the code to this