-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete
maud_htmlescape
package (#311)
Replace it with a symlink. Cargo will automatically resolve this to a normal file on publish.
- Loading branch information
1 parent
45157fc
commit 3232fb7
Showing
12 changed files
with
154 additions
and
126 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
[workspace] | ||
members = [ | ||
"maud_htmlescape", | ||
"maud_macros", | ||
"maud", | ||
] | ||
|
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
extern crate alloc; | ||
|
||
use alloc::string::String; | ||
|
||
pub fn escape_to_string(input: &str, output: &mut String) { | ||
for b in input.bytes() { | ||
match b { | ||
b'&' => output.push_str("&"), | ||
b'<' => output.push_str("<"), | ||
b'>' => output.push_str(">"), | ||
b'"' => output.push_str("""), | ||
_ => unsafe { output.as_mut_vec().push(b) }, | ||
} | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
extern crate alloc; | ||
|
||
use super::escape_to_string; | ||
use alloc::string::String; | ||
|
||
#[test] | ||
fn it_works() { | ||
let mut s = String::new(); | ||
escape_to_string("<script>launchMissiles()</script>", &mut s); | ||
assert_eq!(s, "<script>launchMissiles()</script>"); | ||
} | ||
} |
This file contains 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.