This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[derive(Debug)] | |
| struct Person { | |
| name: String, | |
| age: usize, | |
| } | |
| // We implement the Default trait to use it as a fallback | |
| // when the provided string is not convertible into a Person object | |
| impl Default for Person { | |
| fn default() -> Person { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Fragment } from 'react' | |
| import PropTypes from 'prop-types' | |
| class FetchDataButton extends React.Component { | |
| state = { data: null } | |
| fetchData = () => ( | |
| fetch('https://swapi.co/api/people/1') | |
| .then(rs => rs.json()) | |
| .then(rs => this.setState({ data: rs })) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>{course_title}| Unschool.org</title><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/></head><body bgcolor="#bbddcc"><div style="position:relative;top:0;left:0;max-width:720px;margin:0 auto;font-size:.85em;background-color:#ecf0f1;"><div><img src="http://i335.photobucket.com/albums/m463/pmquan1993/uuu.png" alt="unschool logo" style="width:100%;height:auto;margin:0 auto;text-align:center;outline:0;border:none;display:block;"/></div><div style="font-size:1.5em;font-weight:700;margin:20px auto 10px;padding:10px;text-align:center;border-bottom:1px solid #2980b9;">{course_title}</div><div style="padding: 10px;">{{message_body}}</div><div style="background-color:#2c3e50;color:#fff;font-size:14px;padding:10px;margin:20px 0 0;"><p>©2014 UnSchool.org</p |