relocate files_to_stdenv

This commit is contained in:
Graham Christensen 2018-09-03 15:57:17 -04:00
parent b964b410b8
commit ffb7ab30e6
No known key found for this signature in database
GPG key ID: ACA1C1D120C83D5C
3 changed files with 11 additions and 8 deletions

8
ofborg/src/files.rs Normal file
View file

@ -0,0 +1,8 @@
use std::io::Read;
use std::fs::File;
pub fn file_to_str(f: &mut File) -> String {
let mut buffer = Vec::new();
f.read_to_end(&mut buffer).expect("Reading eval output");
return String::from(String::from_utf8_lossy(&buffer));
}

View file

@ -36,6 +36,7 @@ pub mod config;
pub mod message;
pub mod tasks;
pub mod evalchecker;
pub mod files;
pub mod nix;
pub mod stats;
pub mod ghevent;
@ -61,6 +62,7 @@ pub mod ofborg {
pub use message;
pub use tasks;
pub use evalchecker;
pub use files;
pub use commitstatus;
pub use ghevent;
pub use nix;

View file

@ -5,13 +5,12 @@ extern crate uuid;
use uuid::Uuid;
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use std::path::PathBuf;
use ofborg::checkout;
use ofborg::message::{massrebuildjob, buildjob};
use std::time::Instant;
use ofborg::files::file_to_str;
use ofborg::nix;
use ofborg::acl::ACL;
use ofborg::stats;
@ -730,12 +729,6 @@ pub fn update_labels(issue: &hubcaps::issues::IssueRef, add: Vec<String>, remove
}
}
fn file_to_str(f: &mut File) -> String {
let mut buffer = Vec::new();
f.read_to_end(&mut buffer).expect("Reading eval output");
return String::from(String::from_utf8_lossy(&buffer));
}
fn parse_commit_messages(messages: Vec<String>) -> Vec<String> {
messages
.iter()