Benign cargo Download

writer.rs

Contains an unbounded block loopSource uses a buffer write call
SHA-25625ff5ad6a8311d146a5b812024338b5b57a66266f861f92f2ff7376b56664c24
MaleculeH₂(DbF₂)

Evidence

imports BorrowBytes lines 1–17
1use std::error::FromError;
2use std::old_io as io;
3use std::str;
4
5use rustc_serialize::Encodable;
6
7use {
8 BorrowBytes, ByteString, CsvResult, Encoded, Error, RecordTerminator,
9 StrAllocating,
10};
11
12/// The quoting style to use when writing CSV data.
13#[derive(Copy)]
14pub enum QuoteStyle {
15 /// This puts quotes around every field. Always.
16 Always,
17 /// This puts quotes around fields only …
English function-word token "for" lines 32–33
32/// This writer provides a convenient interface for encoding CSV data. While
33/// creating CSV data is much easier than parsing it, having a writer …
Rust File::create call lines 84–92
84:39… riter<io::IoResult<io::File>> {
85 Writer::from_writer(io::File::create(path))
86 }
87}
⋯5 lines
Source uses a buffer write call lines 359–364
359:9… _bytes(&mut self, s: &[u8]) -> CsvResult<()> {
360 self.buf.write_all(s).map_err(Error::Io)
361 }
362
363 fn w_user_bytes(&mut self, s: &[u8]) -> CsvResult<()> {
364 if try!(self.should_quote(s)) { …
Contains an unbounded block loop lines 424–430
424:23… Vec::with_capacity(s.len() + 2);
425
426 buf.push(self.quote);
427 loop {
428 match s.position_elem(&self.quote) {
429 None => {
430 buf.extend(s.iter().map(|&x|x)); …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.