mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Origin: Use SourcePath
This commit is contained in:
parent
94812cca98
commit
a9759407e5
9 changed files with 22 additions and 23 deletions
|
@ -31,9 +31,9 @@ struct PosAdapter : AbstractPos
|
|||
// Get rid of the null terminators added by the parser.
|
||||
return std::string(s.source->c_str());
|
||||
},
|
||||
[](const Path & path) -> std::optional<std::string> {
|
||||
[](const SourcePath & path) -> std::optional<std::string> {
|
||||
try {
|
||||
return readFile(path);
|
||||
return path.readFile();
|
||||
} catch (Error &) {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ struct PosAdapter : AbstractPos
|
|||
[&](const Pos::none_tag &) { out << "«none»"; },
|
||||
[&](const Pos::Stdin &) { out << "«stdin»"; },
|
||||
[&](const Pos::String & s) { out << "«string»"; },
|
||||
[&](const Path & path) { out << path; }
|
||||
[&](const SourcePath & path) { out << path; }
|
||||
}, origin);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue