Take a reference to the stream instead of the stream itself (in `is_tty`
This commit is contained in:
		
							parent
							
								
									e63b645859
								
							
						
					
					
						commit
						0d1025c532
					
				|  | @ -1,6 +1,6 @@ | ||||||
| [package] | [package] | ||||||
| name = "termion" | name = "termion" | ||||||
| version = "1.0.8" | version = "1.1.0" | ||||||
| authors = ["ticki <Ticki@users.noreply.github.com>"] | authors = ["ticki <Ticki@users.noreply.github.com>"] | ||||||
| description = "A bindless library for manipulating terminals." | description = "A bindless library for manipulating terminals." | ||||||
| repository = "https://github.com/ticki/termion" | repository = "https://github.com/ticki/termion" | ||||||
|  |  | ||||||
|  | @ -3,7 +3,7 @@ use std::os::unix::io::AsRawFd; | ||||||
| 
 | 
 | ||||||
| /// Is this stream an TTY?
 | /// Is this stream an TTY?
 | ||||||
| #[cfg(not(target_os = "redox"))] | #[cfg(not(target_os = "redox"))] | ||||||
| pub fn is_tty<T: AsRawFd>(stream: T) -> bool { | pub fn is_tty<T: AsRawFd>(stream: &T) -> bool { | ||||||
|     use libc; |     use libc; | ||||||
| 
 | 
 | ||||||
|     unsafe { libc::isatty(stream.as_raw_fd()) == 1} |     unsafe { libc::isatty(stream.as_raw_fd()) == 1} | ||||||
|  | @ -11,7 +11,7 @@ pub fn is_tty<T: AsRawFd>(stream: T) -> bool { | ||||||
| 
 | 
 | ||||||
| /// This will panic.
 | /// This will panic.
 | ||||||
| #[cfg(target_os = "redox")] | #[cfg(target_os = "redox")] | ||||||
| pub fn is_tty<T: AsRawFd>(_stream: T) -> bool { | pub fn is_tty<T: AsRawFd>(_stream: &T) -> bool { | ||||||
|     unimplemented!(); |     unimplemented!(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue