Przeglądaj źródła

Update for array syntax pt-2.

Nerijus Arlauskas 11 lat temu
rodzic
commit
efd2860c8c
3 zmienionych plików z 10 dodań i 12 usunięć
  1. 7 9
      src/encode_sets.rs
  2. 2 2
      src/host.rs
  3. 1 1
      src/percent_encoding.rs

+ 7 - 9
src/encode_sets.rs

@@ -8,7 +8,7 @@
 
 // Generated by make_encode_sets.py
 
-pub static SIMPLE: [&'static str, ..256] = [
+pub static SIMPLE: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -44,7 +44,7 @@ pub static SIMPLE: [&'static str, ..256] = [
 ];
 
 
-pub static QUERY: [&'static str, ..256] = [
+pub static QUERY: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -80,7 +80,7 @@ pub static QUERY: [&'static str, ..256] = [
 ];
 
 
-pub static DEFAULT: [&'static str, ..256] = [
+pub static DEFAULT: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -116,7 +116,7 @@ pub static DEFAULT: [&'static str, ..256] = [
 ];
 
 
-pub static USERINFO: [&'static str, ..256] = [
+pub static USERINFO: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -152,7 +152,7 @@ pub static USERINFO: [&'static str, ..256] = [
 ];
 
 
-pub static PASSWORD: [&'static str, ..256] = [
+pub static PASSWORD: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -188,7 +188,7 @@ pub static PASSWORD: [&'static str, ..256] = [
 ];
 
 
-pub static USERNAME: [&'static str, ..256] = [
+pub static USERNAME: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -224,7 +224,7 @@ pub static USERNAME: [&'static str, ..256] = [
 ];
 
 
-pub static FORM_URLENCODED: [&'static str, ..256] = [
+pub static FORM_URLENCODED: [&'static str; 256] = [
    "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
    "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F",
    "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
@@ -258,5 +258,3 @@ pub static FORM_URLENCODED: [&'static str, ..256] = [
    "%F0", "%F1", "%F2", "%F3", "%F4", "%F5", "%F6", "%F7",
    "%F8", "%F9", "%FA", "%FB", "%FC", "%FD", "%FE", "%FF",
 ];
-
-

+ 2 - 2
src/host.rs

@@ -32,7 +32,7 @@ pub enum Host {
 /// A 128 bit IPv6 address
 #[deriving(Clone, Eq, PartialEq, Copy)]
 pub struct Ipv6Address {
-    pub pieces: [u16, ..8]
+    pub pieces: [u16; 8]
 }
 
 
@@ -245,7 +245,7 @@ impl Show for Ipv6Address {
 }
 
 
-fn longest_zero_sequence(pieces: &[u16, ..8]) -> (int, int) {
+fn longest_zero_sequence(pieces: &[u16; 8]) -> (int, int) {
     let mut longest = -1;
     let mut longest_length = -1;
     let mut start = -1;

+ 1 - 1
src/percent_encoding.rs

@@ -29,7 +29,7 @@ mod encode_sets;
 /// explaining the use case.
 #[deriving(Copy)]
 pub struct EncodeSet {
-    map: &'static [&'static str, ..256],
+    map: &'static [&'static str; 256],
 }
 
 /// This encode set is used for fragment identifier and non-relative scheme data.