diff options
Diffstat (limited to 'examples2d')
| -rw-r--r-- | examples2d/all_examples2.rs | 6 | ||||
| -rw-r--r-- | examples2d/trimesh2.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/examples2d/all_examples2.rs b/examples2d/all_examples2.rs index 032e4d6..4cdbf98 100644 --- a/examples2d/all_examples2.rs +++ b/examples2d/all_examples2.rs @@ -57,8 +57,8 @@ fn demo_name_from_url() -> Option<String> { #[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))] pub fn main() { let demo = demo_name_from_command_line() - .or_else(|| demo_name_from_url()) - .unwrap_or(String::new()) + .or_else(demo_name_from_url) + .unwrap_or_default() .to_camel_case(); let mut builders: Vec<(_, fn(&mut Testbed))> = vec![ @@ -85,7 +85,7 @@ pub fn main() { ]; // Lexicographic sort, with stress tests moved at the end of the list. - builders.sort_by(|a, b| match (a.0.starts_with("("), b.0.starts_with("(")) { + builders.sort_by(|a, b| match (a.0.starts_with('('), b.0.starts_with('(')) { (true, true) | (false, false) => a.0.cmp(b.0), (true, false) => Ordering::Greater, (false, true) => Ordering::Less, diff --git a/examples2d/trimesh2.rs b/examples2d/trimesh2.rs index 219a583..2cb8410 100644 --- a/examples2d/trimesh2.rs +++ b/examples2d/trimesh2.rs @@ -104,7 +104,7 @@ pub fn init_world(testbed: &mut Testbed) { testbed.look_at(point![0.0, 20.0], 17.0); } -const RAPIER_SVG_STR: &'static str = r#" +const RAPIER_SVG_STR: &str = r#" <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg width="100%" height="100%" viewBox="0 0 527 131" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;"> <g transform="matrix(1,0,0,1,1,-673)"> |
