Get the source code lines.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use crate::error::CustomError;
|
||||
|
||||
use super::registry::Registry;
|
||||
use super::util::GetFullLines;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct ISrcBlock {
|
||||
@@ -12,9 +13,11 @@ impl ISrcBlock {
|
||||
registry: &mut Registry<'parse>,
|
||||
original: &organic::types::SrcBlock<'parse>,
|
||||
) -> Result<ISrcBlock, CustomError> {
|
||||
// let contents = original.contents.
|
||||
Ok(ISrcBlock {
|
||||
lines: Vec::new(), // TODO
|
||||
})
|
||||
let lines = original
|
||||
.contents
|
||||
.full_lines()
|
||||
.map(|s| s.to_owned())
|
||||
.collect();
|
||||
Ok(ISrcBlock { lines })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user