Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence warning with minor cleanup #75

Merged
merged 1 commit into from Dec 17, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Silence warning with minor cleanup

  • Loading branch information
TimNN committed Dec 17, 2015
commit c58cf56863850493e59f297ddc266ce41ff2a2c9
@@ -19,7 +19,6 @@ use std::fmt;
use std::str::{self, FromStr};
use std::mem;
use std::ptr;
use std::vec::Vec;
use std::ffi::CStr;

/// An immutable string in one of a variety of encodings.
@@ -77,8 +76,7 @@ impl fmt::Display for CFString {
&mut bytes_required);

// Then, allocate the buffer and actually copy.
let mut buffer = Vec::with_capacity(bytes_required as usize);
for _ in (0..bytes_required) { buffer.push('\x00' as u8) }
let mut buffer = vec![b'\x00'; bytes_required as usize];

let mut bytes_used: CFIndex = 0;
let chars_written = CFStringGetBytes(self.0,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.